PHP errors and logs
Where to find error_log, how to enable error logging and how to read errors when troubleshooting.
When a site reports a 500 error or is blank, the cause is almost always written in a log. Reading the log is the first step of every troubleshooting.
Where the logs are#
- cPanel → Metrics → Errors: the last few lines of server errors for your domain.
- The
error_logfile: PHP usually writes it to the folder where the error occurred (e.g.public_html/error_log). Open it in File Manager. - Raw logs: some settings also give access to access and error logs in Metrics → Raw Access.
- Repeat the action that causes the error.
- Open Metrics → Errors or
error_log. - Look at the last lines: they contain the time, error type, file and line number.
- Look up the message: e.g. "Parse error" (syntax), "Fatal error: Allowed memory size" (PHP settings), "Call to undefined function" (PHP extensions), "Cannot redeclare" (duplicate function, often two plugins).
Enabling error logging#
In MultiPHP INI Editor set log_errors to On and display_errors to Off (so visitors do not see the messages). Details: PHP settings. For WordPress see WordPress white screen.
Common errors#
- A 500 error or a wrong
.htaccess: Error 500. - A blank page: White screen.
- After changing the version: Changing the PHP version.
If you cannot find the cause, send a ticket and attach the last lines of the log.
Cet article vous a-t-il été utile ?
Merci pour votre retour ! Besoin d’aide ? Ouvrez un ticket.
Articles associés
Changing the PHP versionHow to choose a PHP 8.x version for a domain in MultiPHP Manager and what to check afterwards.PHP settings (MultiPHP INI Editor)How to change memory_limit, upload_max_filesize, max_execution_time and other PHP directives.Error 500 (Internal Server Error)What error 500 means and how to fix it: .htaccess, PHP version, plugins and logs.White screen (blank page)The page loads but is blank: PHP errors, memory, plugins and how to turn on error display.
