# Find your error log
Source: https://docs.webgee.com/en/development/how-do-i-find-my-error-log-file-to-find-errors-for-my-php-application



Find the errors behind a blank page or a 500 error. Applies to shared, reseller
and Premium hosting.

The log is the difference between guessing and knowing. A 500 error page says
nothing; the log names the file and line.

## Where to look [#where-to-look]

| Log                               | Location                                        | Contains                                 |
| --------------------------------- | ----------------------------------------------- | ---------------------------------------- |
| **Your site's PHP errors**        | `error_log` in the same directory as the script | Fatal errors, warnings, notices          |
| **Apache errors for the account** | `~/logs/`                                       | Server-level errors, permission failures |
| **cPanel Errors**                 | **cPanel → Errors**                             | The most recent entries, no SSH needed   |

The one you usually want is `error_log` in your document root, or in whichever
subdirectory the failing script lives.

## Read it [#read-it]

In **File Manager**, enable **Show Hidden Files**, then open `error_log`. The
newest entries are at the bottom.

Over SSH:

```bash
tail -n 50 ~/public_html/error_log

# watch it live while reproducing the problem
tail -f ~/public_html/error_log
```

`tail -f` is the most useful: run it, trigger the error in a browser, and watch
the entry appear. That removes any doubt about which entry corresponds to your
problem.

## What the entries mean [#what-the-entries-mean]

```
PHP Fatal error:  Uncaught Error: Call to undefined function foo()
in /home/user/public_html/wp-content/plugins/example/file.php:42
```

The **file and line** are the useful part. Here it is a plugin called `example`,
line 42.

* **Fatal error** — execution stopped. This is your blank page or 500.
* **Warning** / **Notice** — logged but execution continued. Usually noise,
  unless they correlate with the problem.

## If there is no error\_log [#if-there-is-no-error_log]

* **PHP error logging is off for that directory.** Enable it temporarily — see
  [Enable error logging in a PHP script](/en/development/how-do-i-enable-error-logging-in-my-php-script).
* **The error is not from PHP.** A 500 caused by `.htaccess` or by file
  permissions appears in `~/logs/`, not in `error_log` — see
  [File and directory permissions](/en/hosting/what-file-and-directory-permissions-should-i-use-for-my-web-files).
* **You are looking in the wrong directory.** Each directory gets its own
  `error_log`. Search for it: `find ~ -name error_log`.

## Delete it when you are done [#delete-it-when-you-are-done]

`error_log` grows without limit, and a site erroring on every request can produce
a file large enough to fill your disk quota. Delete it once fixed — it is
recreated when needed.

## Related [#related]

* [Enable error logging in a PHP script](/en/development/how-do-i-enable-error-logging-in-my-php-script)
* [PHP 500 errors and how to resolve them](/en/development/php-500-errors-and-how-to-resolve-them)
