Today, you are ready to put a PHP demo under IIS, and the Web site is configured under IIS:
The application pool is in Integrated mode. NET Framework 2.0 (2.0 or 4.0 is not related, because PHP runs in fastcgi mode), the application pool identity is configured as IIS built-in NetworkService, and the authentication method used is anonymous authentication.
A 500 error occurred while opening the local Web site and accessing the PHP page.
Well, it's a privilege problem, the simplest solution is to set the C:\Users\Administrator\PhpstormProjects\phpDemo permissions to everyone and allow Full Control:
Re-visit the PHP page, successfully:
The above method is simple enough, but also too unsafe, usually local set up a demo to do so no problem, the real on-line, this will be a problem sooner or later.
Then reset, assign the read-only permission in the directory to the Netwrorkservice account and try again.
But the problem is still not resolved, when the visit, there were 401 errors
The error message includes showing the logged-on user as anonymous, checking for authentication under the site (click Anonymous Authentication, edit), the original site by default, when the login method is anonymous, the default login user is IUSR (the anonymous logged-on user we see)
So the solution is:
1. Set IUSR to read access to C:\Users\Administrator\PhpstormProjects\phpDemo, similar to the previous settings for NetworkService.
2. Or choose to use the application pool identity.
After testing, both methods 1 and 2 were successful.
Note:networkservice in IIS7 in the Iis_iusers user group, before the NetworkService settings can also be changed to iis_iusers settings, the same can solve the problem, but the permissions are further relaxed just.
The above describes PHP in fastcgi run under IIS, encountered the file system permissions problems and solutions, including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.