Sabyasachi Gupta
Sabyasachi Gupta

Reputation: 163

Error log not visible through windows explorer

I am unable to view the error log file or the log folder itself . By running phpinfo() through a php file on localhost , I am able to get the path of error log file as C:\xampp\php\logs\php_error_log, both for local value and master value .

I am unable to understand why the log folder itself is not visible in c:\xampp\php, while it is being shown by phpinfo() .

I have added a jpg file along with this question which shows :

I couldn't find an answer to my question on any one of the sites on the internet including stackoverfow . There were questions and answers in stackoverflow which addresses the problem of error log not working . But I couldn't find an answer to my problem where the log folder itself is not visible .

I have downloaded xampp 5.6.21 .

Any help will be appreciated.enter image description here

Upvotes: 0

Views: 263

Answers (1)

Sabyasachi Gupta
Sabyasachi Gupta

Reputation: 163

I am sharing my findings as an answer to my question . These findings are based on some valuable inputs provided by syck. Here are my findings :

  • Path of error log file using phpinfo() - If you run phpinfo() through a php file on your localhost, the path of the error log file is displayed . In my case it was "C:\xampp\php\logs\php_error_log".
  • logs folder needs to be created : Even though the path of error log file is displayed by using phpinfo(), PHP doesn't create the logs folder on its own . We need to create the logs folder in c:\xampp\php folder . It is only then that the php_error_log file is automatically generated by PHP, and placed in the logs folder, when an error or warning occurs in any one of our PHP files.
  • Visibility of error log file : The php_error_log file is visible through the windows explorer once the logs folder is created and the error log file is generated and placed in the logs folder.
  • Output the raw content of the error log file : We can output the raw contents of the log file by using nl2br(file_get_contents("C:/xampp/php/logs/php_error_log"));

Upvotes: 1

Related Questions