An error log is a file where your website’s software writes down what went wrong, with the time and place. It is the first thing to check when a site breaks. Instead of guessing which pluginA WordPress plugin is an add-on you install in WordPress to give your site extra features, such as contact forms, SEO tools or a webshop. is to blame, you read what was written down at the moment it failed.
What is an error log?
PHPPHP is a programming language that builds your web pages on the computer that hosts your site, just before they reach the visitor. WordPress runs on it. or the web serverA web server is the program, such as Apache, Nginx or LiteSpeed, that answers when a visitor opens your site and sends back the page and files. records each error with the time, the file and the line.
When PHP meets a problem, it can show the message on screen, write it to a file or both. On a live site, the right choice is the file. The setting log_errors turns writing on, error_log names the file, and display_errors decides whether visitors see messages. All three live in php.iniphp.ini is the settings file for PHP on your hosting. It sets limits, such as how much memory a script may use, how big an upload may be and if errors show.. The web server keeps its own error log as well, with problems such as a bad configuration or a timeout.
A line in the log has a time, a level, a message, a file and a line number. The level tells you how serious it is: a notice or deprecationA deprecation is an early warning that a feature still works today but will be removed in a future PHP version, so code using it must be changed in time. is a warning, a fatal error stopped the script.
WordPress debug.log
WordPressWordPress is free software for building and editing a website in your browser. It is written in PHP, so it builds each page when someone visits. can write its own log. When WP_DEBUG and WP_DEBUG_LOG are set to true in wp-config.php, messages go to debug.log inside the wp-content folder. See WP_DEBUGWP_DEBUG is a WordPress setting that makes hidden errors visible or saves them to a file, which helps find out why a site shows a blank page. for the details. It is useful, but it is a temporary tool, so turn it off when you are done.
Reading the log when your site is down
Open the log and go to the end, because the newest entries are at the bottom. Look for the first Fatal error around the moment the problem started. A path with wp-content/plugins/ followed by a folder name tells you which plugin triggered it. A message about allowed memory size points to the memory_limitmemory_limit is a PHP setting that decides how much memory the code behind one page may use. If it needs more, it stops with an error.. A message about a function that does not exist often points to a PHP versionA PHP version is a numbered edition of PHP, like 8.3. Each edition is looked after for a limited time, then gets security fixes only, then nothing. mismatch.
Do not look only at the last line. A single failure can cause a chain of messages, and the first one in the chain is usually the cause.
How to find the log
Your hostingWeb hosting is the service that keeps your website's files on a computer that is always online, so visitors can open your site at any time. control panelA hosting control panel, such as cPanel, Plesk or DirectAdmin, is the web page where you manage your domain, email, databases and PHP version. usually has a logs or error section. On some hosts there is a file named error_log in the site folder. On a VPSA VPS (virtual private server) is your own virtual computer inside a bigger shared machine. You get more control than on shared hosting, and more to manage. the web server log is often under /var/log, and the PHP log depends on the configuration. If you cannot find it, ask your host to send you the last fifty lines for your domainA domain name is the address people type to reach your website, such as yourcompany.com. It points visitors to wherever your site is hosted..
When to act
Read the log when a page shows a critical error, a white screen or a 500 error, and after every PHP update. Keep it away from public access, because logs can contain paths and sometimes personal data. If you read the message but cannot tell what to change, or the site is down and customers are waiting, our emergency help for a website down takes it from there.
Frequently asked questions
Where do I find the PHP error log?
Look in your hosting control panel, in the site folder for a file called error_log, or in the logs section of your host. In WordPress, debug.log in the wp-content folder appears when debug logging is on.
Is it safe to show errors on my live site?
No. Error messages can show file paths and other details about your setup. On a live site, keep display_errors off and log errors to a file instead.
What do I look for in an error log?
Start with the newest entries of the type Fatal error. Each line has a time, a message and the file and line. A path inside wp-content/plugins or wp-content/themes names the plugin or themeA WordPress theme is a ready-made package that decides how your WordPress site looks and how its pages are laid out. Change the theme and the design changes..
How big can an error log get?
A log that is never cleaned can grow very large and fill the disk. Hosts usually rotate logs. If you enable debug logging yourself, turn it off when you are done.