GoDaddy Help

Review PHP error log

If your site is built using PHP, you will need to review the PHP error_log when troubleshooting a problem. This logfile contains information about errors in specific PHP files, calls to missing files, or errors related to the configuration of PHP. PHP error logs are normally found within your site's files.

Why would I need to review this log?

  • Your site is not working as intended.
  • One or more pages of your site has an error, like a 500 Internal server error.
  • Your site is loading a blank page or just spins and never loads.

Log location

WHM/cPanel:
/home/cpanel_username/logs/$DOMAIN.php.error.log
Plesk:
 
/var/www/vhosts/$DOMAIN/logs/$DOMAIN.error_log

How can I review this log?

SSH

SSH allows you to access, view and manipulate the full log with tools such as vim or grep.

cPanel

You can review the PHP error log in the File Manager under Logs for the site.

Plesk

Plesk will display site specific errors within the File Manager under Logs.

Example errors found in a PHP error log

PHP Fatal errors can prevent a site (or page) from loading.
[14-Sep-2021 22:31:09 UTC] PHP Fatal error:  require(): Failed opening required '/home/acoolsite/public_html/wp-content/themes/twentytwentyone/inc/template-functions.php' (include_path='.:/opt/cpanel/ea-php74/root/usr/share/pear') in /home/acoolsite/public_html/wp-content/themes/twentytwentyone/functions.php on line 534
PHP Warnings will typically allow a site (or page) to load, but something may not work.
[21-Sep-2021 18:38:21 UTC] PHP Warning:  call_user_func_array() expects parameter 1 to be a valid callback, function 'twenty_twenty_one_setup' not found or invalid function name in /home/acoolsite/public_html/wp-includes/class-wp-hook.php on line 303
Some PHP Fatal errors are due to a coding problem and will provide a stack trace to help troubleshoot. This can be especially helpful when your application has hundreds of files like WordPress sites.
[21-Sep-2021 20:30:53 UTC] PHP Fatal error:  Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, function "twenty_twenty_one_setup" not found or invalid function name in /home/acoolsite/public_html/wp-includes/class-wp-hook.php:303
Stack trace:
#0 /home/acoolsite/public_html/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters(NULL, Array)
#1 /home/acoolsite/public_html/wp-includes/plugin.php(470): WP_Hook->do_action(Array)
#2 /home/acoolsite/public_html/wp-settings.php(556): do_action('after_setup_the...')
#3 /home/acoolsite/public_html/wp-config.php(112): require_once('/home/acoolsit...')
#4 /home/acoolsite/public_html/wp-load.php(50): require_once('/home/acoolsit...')
#5 /home/acoolsite/public_html/wp-blog-header.php(13): require_once('/home/acoolsit...')
#6 /home/acoolsite/public_html/index.php(17): require('/home/acoolsit...')
#7 {main}
  thrown in /home/acoolsite/public_html/wp-includes/class-wp-hook.php on line 303
Sessions are used for logins, shopping carts, and search results on a site.
[25-Sep-2021 21:10:11 UTC] PHP Warning:  session_start(): Cannot start session when headers already sent in /home/acooldomain/public_html/wp-content/plugins/favorites/app/Bootstrap.php on line 83
This indicates either a missing file or bad path in the code.
[25-Sep-2021 21:08:46 UTC] PHP Warning:  require(ABSPATHWPINC/blocks/archives.php): failed to open stream: No such file or directory in /home/acooldomain/public_html/wp-includes/blocks/index.php on line 9
This indicates the PHP memory_limit value has been reached. Increasing this value in the php.ini can resolve this in many cases.
[14-Oct-2021 22:31:09 UTC] Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 54 bytes
This is likely due to deprecated code. The PHP module "mysql_connect" does not exist in PHP 7+.
[14-Oct-2021 20:31:09 UTC] Fatal error: Call to undefined function mysql_connect()
This issue can be using the wrong PHP version or a mistake in the code.
[12-Oct-2021 21:31:09 UTC] PHP Parse error:  syntax error, unexpected T_VARIABLE in /home/coolexample/public_html/a.php on line 3
This issue can be due to a full disk, inode quota reached on the server or even a size limit (for the site) setup in cPanel or Plesk.
[13-Oct-2021 10:31:09 UTC] PHP Warning:  session_start(): open(/home/coolexample/tmp/sess_2p27rr5idh5danjle3e237c4s4, O_RDWR) failed: No space left on device

Related Steps

More Info

Find and review web server logs.

Share this article