When I get a PHP error it comes up with a 500 internal server error page. I would like it to display the fatal error. I have spent literally days trying to get it to display the proper error. Here is what I have tried so far:
1) Editing the wp-config.php file as described here: https://help.massivedynamic.co/hc/en-us/articles/115000572108-How-to-enable-WordPress-error-reporting. I tried both the option to display the error and create logs.
2) Access Plesk and making changes according to https://support.managed.com/kb/a1937/how-to-enable-php-error-logging-in-plesk-11.aspx. This seems to change the user.ini file to read: [PHP]
display_errors=on
. I have also tried changing the directory here manually but to no avail.
error_log="d:PleskVHOSTS[MYDOMAIN]php.log.resources"
log_errors=on
3) Adding various assortment of code in the header of the page. error_reporting(E_ALL); ini_set('display_errors', 'on'); echo "aaa"; ob_flush();
being one of many.
Can anyone suggest what more I could try?
Thank you.
3
Answers
Search your wordpress root for error_log file. Depending from your setup, it is there, or on your wamp stack log folder.
Like already commented, 500 is not a PHP error but a server error, so you can’t get it printed out with PHP.
a 500 is a code error, or a server system error.
you can several things you can do to debug:
full error reporting. Put this at the top of your script if you dont have access to php.ini:
You can view the error by accessing the Apache error log file for your virtual host.
If your virtual host is called example.com, then your error log file should be located at /var/www/vhosts/example.com/logs/error.log