I already set
//don't display errors
ini_set('display_errors', 0);
//write errors to log
ini_set('log_errors', 1);
//error log file name
ini_set('log_errors', '/var/log/php/error.log');
but I cannot find the log file.
also checked the php.ini but there is no error log. I cannot find directory named var/log/apache
or var/log/php
What I'm trying to do is Log the errors into a file, without showing it on browser
the problem :
I don't see
/var/log/
directory, instead I found/php/logs/
directoryI cannot log the errors without showing it on browser, even after I use
ini_set()
function
Try
\xampp\apache\logs\error.log
where xampp is your installation folder
If you haven't changed the error_log setting in PHP (check with phpinfo()
), it will be logged to the Apache log.
来源:https://stackoverflow.com/questions/43314089/where-is-the-error-log-file