Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Log errors to file (PHP + IIS6 + FastCGI + Win2003 Server)

Though I have read lots of posts and pages concerning the issue (shown below), I guess I'm missing something here. The mais issue is: my PHP errors are not being logged to the file specified nor to the system event log.

My phpinfo() shows: Windows Server 2003, PHP 5.3.6, log_errors = On, error_log = C:\\errorphp.log

I have tried both error_log = C:\Inetpub\logs\php.log and error_log = syslog in php.ini to no effect (either one at a time).

I have:

  1. restarted IIS after every php.ini change
  2. granted the IUSR_XXXXX User Modify permissions on the folder AND the file
  3. tried leaving the directory blank and letting PHP create the file
  4. had a headache.

Any help is much appreciated.

references:

  • PHP Manual - PHP on IIS 6
  • Store PHP errors in a log file
  • IIS PHP doesn't log errors to log file
  • My php error log file is empty
  • Running a defect php file cause error 500
  • Logging PHP to Windows Event Log
like image 920
marquito Avatar asked Aug 20 '12 17:08

marquito


1 Answers

In my case, setting

fastcgi.logging = 1

in php.ini solved the issue and I do have the log file working now (I left the file creation to php itself, my directory was blank)

I'd never guess that as the php.ini itself states (right above the stated config)

; Disable logging through FastCGI connection. PHP's default behavior is to enable this feature.

Go figure.

like image 58
marquito Avatar answered Sep 21 '22 22:09

marquito