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

SMTP Authentication via Scripts

Using SMTP authentication for your scripts, like you would with a mail client, is important for...

Point domain to specific directory via rewrites

If you have a script installed at /example.com and you want http://example.com/ to show the...

Increase PHP memory limit

If you need PHP's memory limit to be increased, please do the following: Create a file called...

Which PHP versions do you support on shared hosting?

We currently support the following PHP versions on our shared hosting servers: 5.6 7.1 7.2...

Changing php.ini directives via .htaccess

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