There are many great code snippets in their Gitlab. You might find more on their…
How to properly Track down „Error 500“ messages
Recently I was working on a wordpress site on a Strato hosting and got some weird compatibility issues with an important plugin (Events Manager). I had a hard time figuring out what the problem was – the only thing I could see was an error 500 when turning it on. Long story short: Here is how to properly track down the error message and solve the issue. At least it workes in my cause, let me know if it did in yours!
First try is to enable the wordpress internal debugging! It is really great! Edit your wp-config.php file and add these lines:
define( 'WP_DEBUG', true); define( 'WP_DEBUG_DISPLAY', true ); define( 'WP_DEBUG_LOG', true );
If this did not yet help, continue as follows:
- Connect via ftp as root to your server
- Open the php.ini file to make sure error reporting is properly set to even log error 500 messages (which it usually does not do for php)
- Locate your php.ini file. On my Strato hosting it was here:
/etc/php.ini
but it could also usually bere found here.
/etc/php5/apache2/php.ini
- Search for
display_errors = Off
Change it to:
display_errors =
On
- Some lines below find:
;display_startup_errors
Change it to:
display_startup_errors = On
That line might be commented out like in my preview by a semicolon. simply remove the semicolon and change the line. Be sure to put the semicolon back in after tracking down the issue, cause error reporting might slow down your server a lot.
- Also make sure taht logging is set to on as well, so if you find:
log_errors = Off
or if this line is set to „On“ but disabled with a leading semicolon, change it to
log_errors = On
- Some lines below find:
;error_reporting
Or something similar, be sure to change it to:
error_reporting = E_ALL
- Restart your server or at least restart php and apache.
- Do what you did to cause the 500 Internal Server error again, and check the log here:
/var/log/httpd/error_log (might alsow be faound here: /var/log/apache2/error.log)
- At the end of the file you find your problem.
- Locate your php.ini file. On my Strato hosting it was here:
- Make sure to return your php.ini to its original state. To maintain server-performance.
FYI: In my case a switched on safe_mode was the culprit. I disabled it in my plesk settings of the corresponding hosting and in the subscription php settings. After another restart the problem was gone.
Dieser Beitrag hat 0 Kommentare