Reputation: 3224
Randomly i keep getting 500 internal server error and I've checked server log the only errors displayed are:
End of script output before headers: admin-ajax.php
End of script output before headers: index.php
I've increased php memory limit and wordpress memory limit to 256m. I'm running a woocommerce shop. When i refresh a resource heavy page multiple times this is most likely when the error appears. The error also randomly goes away after about 5 minutes. I can still access the wordpress readme.html
. I've renamed the plugin folder and still the error remains.
Any idea what would be causing this?
Upvotes: 5
Views: 18093
Reputation: 1
With wordpress there is the possibility that the version of php that you are using may well be the wrong one. Modern wordpress installations need 5.4 or above particularly if using jetpack. I had the issue described by the OP running wordpress 4.8.1 with Jetpack configured and connected to my wordpress.com account when my server was using php version 5.3 I switched versions to 5.4 and the problem was immediately solved.
I hope this helps.
Upvotes: 0
Reputation: 149
I wanted to add this as comment, but unfortunately I don't have enough points.
This can be because of some plugin messing with HTTP headers - have you installed some plugin/theme soon before the errors start showing?
Can you enable WP_DEBUG, to see if you can catch something there, as sometimes it is more useful than the server logs.
To do this, open
wp-config.php
located in the directory where WordPress is installed and then locate the line with the code
define('WP_DEBUG', false);
and change it to
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
That will save the log in a file called debug.log and located in your
wp-content
directory. It is important step to set it log to a file, if you don't want to have errors thrown on the site.
You can also refer to this codex page.
Upvotes: 6
Reputation:
Considering your comment below (mysql server has gone away) and the random 500 (apache/http) internal server error, the server could possibly be under a heavy load. It may be receiving more connections than it can handle until either apache or mysql are unable to respond. I would check with the web hosting provider to verify if the issue is related to the server or your site specifically.
I've run into plugins with memory leaks and all kinds of issues. If it is indeed something with your site, I would try disabling all plugins to see if this resolves the issue, then re-enable them one at a time trying to reproduce the issue.
So then, if you do narrow it down to one plugin - check for (and install) updates (after taking a backup), seek support from the plugin author, seek an alternate plugin, hire a developer, or simply go without it.
Upvotes: 1