Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › error establishing a database connection
This topic contains 12 replies, has 2 voices, and was last updated by Ernest Marcinko 6 years, 9 months ago.
- AuthorPosts
- November 8, 2016 at 10:03 pm #10777
Hello,
I face issue with you plugin after i active in my site, i see this message in Arabic “error establishing a database connection” every 1 to 5 minutes.
like when 200 visitors login site after 200 it will be face this message.thanks
November 9, 2016 at 10:13 am #10785Hi,
Thank you for the details, I’ve looked through your configuration, and made a few changes, that should affect the performace and should fix the issue. I suspect your database might have been overloaded, which caused the problem. You can find all the tweaks on this documentation article as well: https://goo.gl/Rn6lG6
1. I’ve enabled and generated the index table engine. It’s made exactly for cases like yours. It gives a huge performance boost, and reduces the database usage. More about index table here: https://goo.gl/ooNYPY
2. I’ve also enabled the Custom Ajax Handler.
I have also re-enabled the search in the dropdown_boxes.php file in the theme child directory, to see if the problem re-appears. It appears to be working without issues now. I have not made changes to any other files.
I hope this helps!
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 9, 2016 at 9:12 pm #10815HI,
is still message coming out “error establishing a database connection”.
this issue is showing when i have traffic in my site.maybe is from php configuration in my server ?!
November 10, 2016 at 9:57 am #10822Hi,
I don’t think it’s related to the PHP configuration. The error message means, that the database server gets overloaded. It might not be able to handle the search requests.
Try turning off the “Trigger live search while typing” option: https://i.imgur.com/Y2u9uQP.png
It saves a lot of performance, as the plugin is only triggered when the user hits the return button or clicks the Magnifier.Since you have a lot of traffic, I also recommend using a cache plugin, like WP Super cache (you have to enable the cache after activation). It saves a lot of performance, and lot’s of database connections.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 12, 2016 at 6:47 pm #10835Hi,
i do what you told me, but still i face this error.
i turn off Trigger live search while typing and i install WP Super cache.
is not make a different with DB error.November 14, 2016 at 4:27 pm #10844Hi,
Are there any kind of error logs or something else to see?
I’ve tried everything to re-create the problem, but I was not able to.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 15, 2016 at 3:54 pm #10862Hi,
yes you can see error logs in
/public_html/wp-content/debug.logNovember 15, 2016 at 4:55 pm #10865Thanks!
Please not that the file is over 716MB. It’s pretty huge, and it might cause issues for loggers. I highly recommend deleting is occasionally.
I haven’t found any error messages from Ajax Search Pro there though. There are many notices from the theme and the cache plugin, but those should not be a problem. I see warnings as well, which are more important
From the wp-movies plugin:
[15-Nov-2016 15:17:53 UTC] PHP Warning: Creating default object from empty value in /home/hdarab/public_html/wp-content/plugins/wp-movies/classes/movieInfo/class_imdb_api.php on line 625 [15-Nov-2016 15:17:53 UTC] PHP Warning: Creating default object from empty value in /home/hdarab/public_html/wp-content/plugins/wp-movies/classes/movieInfo/class_imdb_api.php on line 188
and from the theme:
[15-Nov-2016 15:30:29 UTC] PHP Warning: ucwords() expects parameter 1 to be string, array given in /home/hdarab/public_html/wp-content/themes/wp_movies-child/dropdown_boxes.php on line 56 [15-Nov-2016 15:30:47 UTC] PHP Warning: array_slice() expects parameter 1 to be array, null given in /home/hdarab/public_html/wp-content/themes/wp_movies-child/functions.php on line 41
These should not be a problem either, these are only warnings, but should be fixed. Unfortunately I see no indication of errors in this file.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 10, 2016 at 10:07 pm #11234You cannot access this content.December 12, 2016 at 3:52 pm #11243Hi,
In which directory can I find the website? I tried var/www/html/ but it’s not that.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 12, 2016 at 4:31 pm #11244Hi,
is CPanel the directory you will be found in /home/hd-arab/public_html
thanks
December 13, 2016 at 7:53 am #11248Hello,
any update about the issue !?
December 13, 2016 at 1:27 pm #11257Hi,
After a long time of searching I have not found any error messages or anything indicating database issues. Then I looked at the PHP configuration and your memory_limit is set to 32M which is very low!!!
WordPress requires at least 64M to run correctly, but it’s recommended to use at least 96 – 512M depending on how many plugins you have and how much the server is uses.
I’ve changed the memory limit via ini_set in your wp-config.php file to 96M (on line 25) and the issue seems to be resolved. If it re-appears just increase the memory limit more slowly, up to 512M if needed.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.