By default, PHP errors and warnings generated by your websites are logged in error_log files in the directory where your PHP files are located. The PHP error_log files can grow to a large size.
If you do not need the error_log file you can disable PHP error logging using one of the three ways listed below:
PHP Selector in cPanel — Recommended
- Log in to cPanel.
- Click Select PHP Version.
- Click Switch To PHP Options
- Set log_errors to Off
- Click Save
.htaccess
- Edit .htaccess in your public_html folder
- Enter the following code:1
php_flag log_errors off
- Save the file.
php.ini
- Create a new file named php.ini in your public_html folder.
- Enter the following code:1
log_errors = off
- Save the file.
Verify your changes
Create a phpinfo php page to check your settings are active.
Delete existing PHP error_log files
- View your webspace using FTP or cPanel File Manager
- Select your error_log file
- Delete