There was a problem loading the comments.

Your own php error.log and displaying errors

Support Portal  »  Knowledgebase  »  Viewing Article

  Print
Is your script not behaving as expected or producing a white page?   If so, it could be a PHP error that is causing it and to find out you can either have errors logged or displayed by using the following .htaccess file directives.

PHP Error Logging:

PHP 5.3 and up -- place following in to .user.ini file in the folder of the php file or the folder above if in a domain's sub folder
error_reporting = 30719
log_errors = on
error_log = /path/to/your/home/user/php_error.log

PHP 5.2 -- legacy via .htaccess file
# PHP Error log
php_value error_reporting 30719
php_flag log_errors on
php_value error_log /path/to/your/home/user/php_error.log
(replace items in red above with real values.  The path can be found via the control panel.)

PHP Display Errors:

PHP 5.3 and up -- place following in to .user.ini file in the folder of the php file or the folder above if in a domain's sub folder
display_errors = on

PHP 5.2 -- legacy via .htaccess file
#PHP display logs
php_flag display_errors on

(change "on" to off if you do not want errors to display)

 

(NOTE: these directives only work on linux servers using apache as the web server (either frontend or backend) as IIS does not support these directives)


Share via

Related Articles

© Cooini, LLC