Вопрос

i have error in my page but it is not logs in to the log file
i have set

display_errors:Off
display_startup_errors:Off
error_log:error_log
log_errors:On

i have restarted apache after configuration but it is not working

just checked the apache file /etc/httpd/logs/error_log file it contain the error but why the error_log does not creating in the folder in which error occurs

Это было полезно?

Решение

try this in your php file

ini_set("log_errors", 1);
ini_set("error_log",$_SERVER['DOCUMENT_ROOT']."/logs/php-error.log");

Give write permission to the folder logs and its file, then check the file in logs folder.

error_log:error_log

error_log not has correct path, set a correct path like below

log_errors = On
error_log =  "C:\xampp\php\logs\php_error_log"

Другие советы

You said:

just checked the apache file /etc/httpd/logs/error_log file it contain the error ...

which means:

  • loggine php errors works
  • all errors are written to /etc/httpd/logs/error_log

You also said:

... but why the error_log does not creating in the folder in which error occurs

Your php.ini directove error_log specifies where your want your error log to be. Now it is default. Specify different log file location and you'll have it in different place. There is no why - it lands where it is said to be.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top