Software⏱️ 2 min read📅 2026-05-31

How to Fix: Where does PHP store the error log? (PHP 5, Apache, FastCGI, and cPanel)

PHP error log location on shared hosting environment.

Quick Answer: Check the php.ini file for the 'error_log' directive, which specifies the path to the error log file.

PHP stores error logs in a file named "error_log", which can be found at the root of your PHP installation directory. However, on shared hosting environments like cPanel, Apache, and FastCGI, this location may vary.

✅ Alternative Locations to Find Error Logs

  • Shared hosting environments often store error logs in a directory like "/var/log/php" or "/var/log/error_log".
  • In cPanel, you can check the "Error Logs" section under the "Advanced" tab in your PHP configuration.

🎯 How to Find Error Logs Using php.ini

Method 1: Check the error_log Directive

  1. Step 1: Look for the "error_log" directive in your php.ini file.
  2. Step 2: Note down the path specified for the error log file.

By following these steps, you should be able to find and view your PHP error logs even on shared hosting environments.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions