> ## Documentation Index
> Fetch the complete documentation index at: https://kb.hosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Enabling PHP error logging

> Configure PHP error logging with log_errors and error_log in php.ini using this detailed guide.

This article describes how to configure PHP error logging by using the **log\_errors** and **error\_log** directives in a *php.ini* file.

<Warning>
  **Important**

  The information in this article only applies to certain types of hosting accounts. To determine whether or not the information below applies to your account, please see [this article](/docs/changing-php-settings-and-versions).

  📘 Note

  This article assumes that you have already set up a custom *php.ini* file on your web site. If you have not already set up a custom *php.ini* file, please read [this article](/docs/custom-php-ini-files) first.
</Warning>

## Enabling error logging

To enable PHP error logging, you need to set two directives in the *php.ini* file:

* **log\_errors**

* **error\_log**

First, use a text editor to set the **log\_errors** directive as shown:

```
log_errors = On
```

Next, set the **error\_log** directive to log PHP errors to a specific file. Replace ***path*** with the path to the log file, and ***filename*** with the log filename:

```
error_log = /path/filename
```

The changes take effect as soon as you save the *php.ini* file.

## Disabling error logging

To disable PHP error logging, modify the **log\_errors** line in the *php.ini* file as follows:

```
log_errors = Off
```

<Tip>
  To verify the current value of the **log\_errors** directive and other directives, you can use the **phpinfo()** function. For more information, please see [this article](/docs/view-php-settings).
</Tip>

## More information

* To view a complete list of *php.ini* directives, please visit [https://secure.php.net/manual/en/ini.list.php](https://secure.php.net/manual/en/ini.list.php).

* For more information about the **log\_errors** directive, please visit [https://secure.php.net/manual/en/errorfunc.configuration.php#ini.log-errors](http://secure.php.net/manual/en/errorfunc.configuration.php#ini.log-errors).

* For more information about the **error\_log** directive, please visit [https://secure.php.net/manual/en/errorfunc.configuration.php#ini.error-log](http://secure.php.net/manual/en/errorfunc.configuration.php#ini.error-log).

## Related articles

* [Custom php.ini files](/docs/custom-php-ini-files)

* [Using php.ini directives](/docs/using-php-ini-directives)
