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.
- 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
- you can also check your htaccess is file or folder is allowed or not.
Related Topics
Move_Uploaded_File Gives "Failed to Open Stream: Permission Denied" Error
How to Store and Retrieve Images from a MySQL Database Using PHP
"Fatal Error: Cannot Redeclare ≪Function≫"
PHP Session Fixation/Hijacking
Form Submit With Ajax Passing Form Data to PHP Without Page Refresh
How to With MySQLi Make a Query With Like and Get All Results
Use PHP to Create, Edit and Delete Crontab Jobs
How to Remove  from the Beginning of a File
Getting the Screen Resolution Using PHP
How to Catch the Fatal Error: Maximum Execution Time of 30 Seconds Exceeded in PHP
PHP: Return All Dates Between Two Dates in an Array
How to Search by Key=≫Value in a Multidimensional Array in PHP
Sort an Array by Keys Based on Another Array