PHP error log on IIS does not write to file
Asked Answered
B

1

8

I am using an IIS 7.5 on Windows Server 2008 R2 together with PHP 5.5 NTS via FastCGI. Somehow my PHP does not want to log errors to a file. The file never gets created and when I create it manually, PHP does not write into it.

This is my php.ini (verified, that it's the one that gets loaded with phpinfo(); )

error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
log_errors = On
error_log = "C:\inetpub\logs\php\php_errors.log"

The specified directory has write access for IIS_IUSRS, IUSR and even the AppPool User (yes I know its redundant, just to make sure). I even turned on display_errors to see if there is an error and it does display the error in my browser but PHP still doesn't want to write an error log.

Edit: [SOLVED]

I was using BasicAuthentication for my website and there the IIS impersonates the user you are logging in with. Therefore I just added my log on user account to the IIS_IUSRS group and now it works.

Brashear answered 20/7, 2013 at 18:3 Comment(0)
V
5

Adding this as a solution text so that it no longer appears on the Unanswered questions list. Answer is provided by question author in the edited question above:

Edit: [SOLVED]

I was using BasicAuthentication for my website and there the IIS impersonates the user you are logging in with. Therefore I just added my log on user account to the IIS_IUSRS group and now it works.

Vindication answered 27/8, 2015 at 15:35 Comment(1)
You need an upvote for it to be removed from that list.Cocoon

© 2022 - 2024 — McMap. All rights reserved.