where is the error_log file?

Citra45Abadi picture Citra45Abadi · Apr 10, 2017 · Viewed 14.4k times · Source

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 :

  1. I don't see /var/log/ directory, instead I found /php/logs/ directory

  2. I cannot log the errors without showing it on browser, even after I use ini_set() function

Answer

vpdeva picture vpdeva · Apr 10, 2017

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.