php error log missing in XAMPP

Soumya Agrawal picture Soumya Agrawal · Apr 6, 2017 · Viewed 19.9k times · Source

php.ini contains following parameters:

track_errors=On
error_reporting=E_ALL & ~E_DEPRECATED & ~E_STRICT
log_errors=On
error_log="C:\xampp\php\logs\php_error_log"

but "logs" folder is missing in this path. Its not even hidden folder. where to find php error logs?

OS:windows 8.1
php version 5.6.24

Answer

Jos Luijten picture Jos Luijten · Apr 20, 2017

Somehow PHP won't create the "logs" folder by itself... and that's what we need to do:

  1. Created the "logs" folder in the correct location (for instance, C:\xampp\php\logs).

  2. Restart Apache using XAMPP control panel (stop and start).

Then when an error occurs the file will be generated fine and you'll be again able to open the PHP logs from XAMPP console

XAMPP PHP logs

To test that it's working you can create a fatal error by using

trigger_error("Some info",E_USER_ERROR);