Your own php error.log and displaying errors

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)

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to create a .htaccess file

Creating a .htaccess is easier then it sounds. You can create an .htaccess file in any text...

http Error codes

The following are http status and error codes that are returned for each file access via a web...

Frontpage Publishing via FTP

Frontpage extensions are not supported on our servers due to bugs in the extensions (some...

How to upload / create your site.

Creating your site How you create your site depends on what you want to do with it.  You...

Changing php.ini directives via .htaccess

A script you want to use requires a different setting then we have set?  No problem, you...