简体   繁体   中英

PHP is not showing errors

i am having trouble seeing PHP Errors with my new Web Server.

Everytime i have an error message i am getting the message 'HTTP-Error 500 (Internal Server Error)' Is there any way to enable the error reporting? The error_reporting(E_ALL); line does not work.

You need to check the error logs that correspond to your web server. Ensure that you have allowed your web server write privileges to the directory of your log files. You can find the location of your log files by checking th error_log variable in your php.ini file.

See here for more information.

Set error_reporting(-1); and ini_set('display_errors', 'On'); This will show your errors. Also make sure your error_log php.ini settings is not set to syslog or a file-name.

To let the server print php error, you can use ini_set() method inside the code. Okay!

Alternativly you can change the php.ini config file. open the file and look for errors and warnings , in this section, you can configure the behavier when a error occured.

You may try htaccess for activating error reporting.

# PHP error handling for development servers
php_flag display_startup_errors on
php_flag display_errors on
php_flag html_errors on
php_flag log_errors on
php_flag ignore_repeated_errors off
php_flag ignore_repeated_source off
php_flag report_memleaks on
php_flag track_errors on
php_value docref_root 0
php_value docref_ext 0
php_value error_log /home/path/public_html/domain/PHP_errors.log
# [see footnote 3] # php_value error_reporting 999999999
php_value error_reporting -1
php_value log_errors_max_len 0

<Files PHP_errors.log>
 Order allow,deny
 Deny from all
 Satisfy All
</Files>

Source: http://perishablepress.com/advanced-php-error-handling-via-htaccess/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM