PHP runs under IIS in a fastcgi way, and the file system permissions problems and workarounds are encountered

Source: Internet
Author: User
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.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.