Where is the WordPress error log located?

Solution 1:

You can specify a custom location for your Apache error log in your virtual host configuration:

ErrorLog /path/to/error/log/error.log

After updating the configuration, restart Apache:

sudo systemctl restart apache2 # Debian/Ubuntu
# or
sudo systemctl restart httpd # CentOS/RHEL

✅ Result:

  • All errors for that virtual host will now be logged to the specified file.
  • You can monitor the file to debug issues with your site.

Solution 2:

If you don’t want to check the error log file every time, you can enable error display in PHP:

Via php.ini:

error_reporting = E_ALL
display_errors = On


ini_set('display_errors', 1);
error_reporting(E_ALL);

Notes:

  • This will display all errors, warnings, and notices directly in the browser.
  • It’s useful for development but should not be used in production, where errors should be logged instead of displayed.