Emanuil Rusev
Emanuil Rusev

Reputation: 35265

Where does PHP's error log reside in XAMPP?

I've been using XAMPP for Windows.

Where does PHP's error log reside in XAMPP?

Upvotes: 111

Views: 246163

Answers (14)

theking2
theking2

Reputation: 2852

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 but that is ApacheFriends for you😜. After creating the folder and restarting Apache the folder will be populated with a php_error_log file. No, not a php_error.log but php_error_log, becouse they are your friends.

Follow

Terminal

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.

Code

You might be using vscode so why not have the errors right at you finger tips. Create a file .vscode\tasks.json

{ 
  // See https://go.microsoft.com/fwlink/?LinkId=733558 
  // for the documentation about the tasks.json format 
  "version": "2.0.0", 
  "tasks": [ 
    { 
      "label": "Monitor php errors", 
      "type": "shell", 
      "command": "Get-Content -Wait c:\\xampp\\php\\logs\\php_error_log", 
      "runOptions": { 
        "runOn": "folderOpen" 
      } 
    } 
  ] 

and allow it to run on start. Make sure you work on a folder, not single files, but you were doing that already, weren't you?

Upvotes: 2

kodeKhalifa
kodeKhalifa

Reputation: 330

For Mac users, it can be found in:

/Applications/XAMPP/xamppfiles/logs/php_error_log

Upvotes: 1

Muhammad bin Yusrat
Muhammad bin Yusrat

Reputation: 1463

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

Upvotes: 5

Anubhav
Anubhav

Reputation: 31

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.

Upvotes: 3

Nemo
Nemo

Reputation: 513

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.

Upvotes: 1

Yin
Yin

Reputation: 21

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.

Upvotes: 2

pushpendra yadav
pushpendra yadav

Reputation: 949

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

Upvotes: 1

Black
Black

Reputation: 20352

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

Enter image description here

Upvotes: 19

boksa
boksa

Reputation: 223

For Mac users, XAMPP version 1.7.3:

/Applications/XAMPP/xamppfiles/logs/error_log

Upvotes: 12

Strainj1
Strainj1

Reputation: 179

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

Upvotes: 17

redolent
redolent

Reputation: 4259

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

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

Upvotes: 0

Hovercat
Hovercat

Reputation: 667

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

Upvotes: 64

greg0ire
greg0ire

Reputation: 23265

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

Upvotes: 3

Lekensteyn
Lekensteyn

Reputation: 66495

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

Upvotes: 147

Related Questions