PHP log error To file in xampp localhost using .htaccess

I need to write PHP errorto a .logfile using .htaccesswith log_errors:

# supress php errors
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off

# enable PHP error logging
php_flag  log_errors on
php_value error_log  C:\xampp\htdocs\cms\cache\logs\PHP_errors.log

# prevent access to PHP error log
<Files PHP_errors.log>
 Order allow,deny
 Deny from all
 Satisfy All
</Files>

Now this file does not work and is .logempty.

NOTE : I change the file .logto 777.

I know xampplog PHP errorto this file:C:\xampp\php\logs\php_error_log.log

+4
source share
2 answers

It may be too late for an answer, but I hope this can be helpful.

Have you tried checking the apache httpd.conf file? The mine contains the following lines:

LogLevel   error
ErrorLog   /app/logs/apache/error/my_log_file.log
CustomLog  /app/logs/apache/access/my_log_file.log combined

These lines save the .htaccess configuration override, maybe this is also your case ...

Hoping to be of Service

+1

htaccess , , , PHP - . PHP . . HUGE - , . , PHP, . , , ( , ). , . , PHP - . , , ....

, . PHP

0

Source: https://habr.com/ru/post/1524479/


All Articles