Reputation: 71
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
Upvotes: 2
Views: 7275
Reputation: 7257
You said:
just checked the apache file /etc/httpd/logs/error_log file it contain the error ...
which means:
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.
Upvotes: 0
Reputation: 3329
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"
Upvotes: 5