500 Internal Server Error For PHP File Not For Html

How can I make PHP display the error instead of giving me 500 Internal Server Error

Check the error_reporting, display_errors and display_startup_errors settings in your php.ini file. They should be set to E_ALL and "On" respectively (though you should not use display_errors on a production server, so disable this and use log_errors instead if/when you deploy it). You can also change these settings (except display_startup_errors) at the very beginning of your script to set them at runtime (though you may not catch all errors this way):

error_reporting(E_ALL);
ini_set('display_errors', 'On');

After that, restart server.

POST 500 Internal Server Error -- PHP

Solved.

The problem Was that : I forgot to do :

require_once('wp-config.php');

At the beginning of the page !

500 Internal Server Error in PHP files

500 Internal Server Error occurs from following reason. you can solve by followng:-
1.If you have not given file permsission you can get this error. Please give file permission.


  1. Or Open Apache’s httpd.conf file
    you have to find following lines, and remove #

    LoadModule rewrite_module modules/mod_rewrite.so

LoadModule headers_module modules/mod_headers.so


  1. you can also check your htaccess is file or folder is allowed or not.


Related Topics



Leave a reply



Submit