I would like to add more detailed information to the existing answer:
# PHP error handling for development servers php_flag display_startup_errors on php_flag display_errors on php_flag html_errors on php_flag log_errors on php_flag ignore_repeated_errors off php_flag ignore_repeated_source off php_flag report_memleaks on php_flag track_errors on php_value docref_root 0 php_value docref_ext 0 php_value error_log /full/path/to/file/php_errors.log php_value error_reporting -1 php_value log_errors_max_len 0
Grant permission 777 or 755 to the log file, and then add the code
<Files php_errors.log> Order allow,deny Deny from all Satisfy All </Files>
at the end of .htaccess. This will protect your log file. These options are suitable for the development server. For a production server, you should not cause errors to the end user. Therefore, change the display flags to.
For more information, follow this link: Advanced PHP error handling through htaccess
Ashish Jan 08 '16 at 9:56 on 2016-01-08 09:56
source share