Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php error log missing in XAMPP

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
like image 816
Soumya Agrawal Avatar asked Apr 06 '17 07:04

Soumya Agrawal


People also ask

Where to find error logs in XAMPP?

\xampp\apache\logs\error.log is the default location of error logs in PHP. Show activity on this post. By default, the XAMPP PHP log file path is in /xampp_installation_folder/php/logs/php_error_log, but I noticed that sometimes it would not be generated automatically.

How to open PHP logs from XAMPP console?

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 Show activity on this post.

Why is XAMPP not working in PHP?

Finally, sometimes XAMPP is not working due to an issue with MySQL, rather than Apache. However, the problem is still often a port conflict, which means that by now you should have a good idea on how to fix it. In this case, you’ll need to access your php.ini file instead of your configuration file.

How do I Find my PHP error logs?

To locate your PHP error logs, open the XAMPP dashboard by typing http://localhost into your browser’s address bar. There, click PHPInfo at the top of the screen: The PHPInfo link in the XAMPP dashboard. Then search for “error_log”.


2 Answers

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);
like image 130
Jos Luijten Avatar answered Oct 01 '22 12:10

Jos Luijten


In my case I solved this problem by making the main settings made in the question, with only two changes:

track_errors=On
error_reporting=E_ALL & ~E_DEPRECATED & ~E_STRICT
log_errors=On

change 1:

error_log="C:\xampp\php\logs\php_errors.log"

in the documentation it says that these methods are deprecated, so it is disabled by default and with the wrong directory.

change 2:

Create the folder 'logs' in: C:\xampp\php

This worked for me, I hope it will be useful.

like image 39
Glenys Mitchell Avatar answered Oct 01 '22 11:10

Glenys Mitchell