An error log is a record of critical errors that are encountered by a website while in operation. Some of the common entries in the PHP error logs include table and configuration corruption. By default, PHP errors and warnings generated by your website are logged in error_log file. The error_log file is useful when debugging scripts and finding missing files or broken links you may not be aware of.
The PHP error_log file can grow to a large size, thus consuming a big chunk of your disk usage and physical memory usage (RAM). This in turn will cause exhaustion of your hosting resources leading to degradation, slowing down and fatal errors to your website. If you do not need the error_log file you can disable PHP error logging using any of the methods listed below.
1. error_log permissions
- Locate the error_log file in the root directory of your WordPress installation. Using cPanel or FTP/SFTP, go to File Manager > public_html.
- Locate the error_log file under the public_html folder, right click on it and select the “Change Permissions” option.
- Unselect the “Write” and “Execute” permissions until the permission code is 444.
- Once done click on “Change Permissions” button to save changes to the error_log file.
2. Select PHP version
- Log in to cPanel.
- Click “Select PHP Version”.
- Click “Options”.
- Uncheck the “log_errors” checkbox.
3. php.ini
- Locate the php.ini file. If you cannot find it, then simply create your own php.ini file and place it in the root directory of your WordPress installation. Using cPanel or FTP/SFTP, go to File Manager > public_html.
- Locate the .php.ini file under the public_html folder, right click on it and select the “Edit” option.
- Locate the line that has; log_errors = On;. If you created your own php.ini file, ensure you add the line.
- Change the log errors from “On” to “Off”.
- Save the php.ini file.
Note:
Many shared hosting providers restrict you from accessing the php.ini file. This method is only applicable in case you have direct access to your php.ini file or if you are running your WordPress on a local host.
4. .htaccess
- Locate the .htaccess file in the root directory of your WordPress installation. If you can’t find it then it might be hidden. Make sure to check your hidden files when locating it. Using cPanel or FTP/SFTP, go to File Manager > public_html.
- Locate the .htaccess file under the public_html folder, right click on it and select the “Edit” option.
- Locate the line that has; php_flag log_errors on. If you can’t find that line, you can simply add it before the # END WordPress line.
- Change the log errors from “on” to “off”.
- Save the .htaccess file.
Obrigado me ajudou muito, um dev havia habilitado e eu não estava sabendo como desativar isso