Where does PHP's error log reside in XAMPP?

PhpApacheXampp

Php Problem Overview


I've been using XAMPP for Windows.

Where does PHP's error log reside in XAMPP?

Php Solutions


Solution 1 - Php

\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.

Solution 2 - Php

I found it in: \xampp\php\logs\php_error_log

Solution 3 - Php

You can also open the XAMPP control panel and click on the button Logs:

Enter image description here

Solution 4 - Php

For Mac users, XAMPP version 1.7.3:

/Applications/XAMPP/xamppfiles/logs/error_log

Solution 5 - Php

\xampp\php\logs did not exist at all for me - for whatever reason.

I simply had to create a folder in \xampp\php\ called logs and then the php_error_log file was created and written to.

Solution 6 - Php

For anyone searching for the PHP log file in XAMPP for Ubuntu, it is:

/opt/lampp/logs/php_error_log

Most probably it will be having a big size (mine was about 350 MBs) and it slowed down my text editor when I opened the file. If you do not care about all the previous logs you can empty the file easily by simply going to the terminal and then writing these three lines one by one:

sudo su 
cd /opt/lampp/logs/
> php_error_log

And newer logs will be easy and fast to open now. The angle bracket empties the file (Works with bash only, doesn't work on zsh).

Solution 7 - Php

Look in your configuration file and search for the error_log setting. Or use phpinfo() to find this setting.

Solution 8 - Php

You can simply check your log path from phpMyAdmin.

Run this:

> http://localhost/dashboard/

Now click PHPInfo (top right corner) or you can simply open this URL in your browser:

> http://localhost/dashboard/phpinfo.php

Now search for "error_log"(without quotes). You will get the log path.

Solution 9 - Php

For my issue, I had to zero out the log:

sudo bash -c ' > /Applications/XAMPP/xamppfiles/logs/php_error_log '

Solution 10 - Php

\xampp\apache\logs\error.log is the default location of error logs in PHP.

Solution 11 - Php

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. Maybe it could be a Windows account write permission problem? I am not sure, but I created the logs folder and php_error_log file manually and then PHP logs were logged in it finally.

Solution 12 - Php

As said in previous answers, you can find the PHP error log in Windows. In C:\xampp\apache\logs\error.log. You can easily display the last logs by tail -f .\error.log.

Solution 13 - Php

For Mac users, it can be found in:

/Applications/XAMPP/xamppfiles/logs/php_error_log

Solution 14 - Php

In the current version I've just installed (8.0.11) the installer "forgets" to create the folder C:\xamppp\php\logs, perhaps by design. After creating the folder and restarting Apache the folder will be populated with a php_error.log file.

Follow

To keep seeing the last entry (much like *nix sh tail -f) use the following command:

Get-Content c:\xampp\php\logs\php_error.log -Wait

This will keep reading the file and display the last entries. Quite handy if you are debugging.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionEmanuil RusevView Question on Stackoverflow
Solution 1 - PhpLekensteynView Answer on Stackoverflow
Solution 2 - PhpHovercatView Answer on Stackoverflow
Solution 3 - PhpBlackView Answer on Stackoverflow
Solution 4 - PhpboksaView Answer on Stackoverflow
Solution 5 - PhpStrainj1View Answer on Stackoverflow
Solution 6 - PhpMuhammad bin YusratView Answer on Stackoverflow
Solution 7 - Phpgreg0ireView Answer on Stackoverflow
Solution 8 - PhpAnubhavView Answer on Stackoverflow
Solution 9 - PhpredolentView Answer on Stackoverflow
Solution 10 - Phppushpendra yadavView Answer on Stackoverflow
Solution 11 - PhpYinView Answer on Stackoverflow
Solution 12 - PhpNemoView Answer on Stackoverflow
Solution 13 - PhpkodeKhalifaView Answer on Stackoverflow
Solution 14 - Phptheking2View Answer on Stackoverflow