Php runs in iis In fastCGI mode. The file system permission problem and solution are as follows,

Source: Internet
Author: User

Php runs in iis In fastCGI mode. The file system permission problem and solution are as follows,

Today, I am going to run a php demo under IIS. The website configuration under IIS is as follows:

The application pool is in integration mode.. Net framework 2.0(2.0 or 4.0 does not matter, because php is running in fastCGI mode), the application pool ID is configured as the built-in IISNETWORKSERVICE, The authentication method used isAnonymous Authentication.

Open a local website and access the php page. The Error 500 is displayed.

 

 

Well, the permission problem is. The simplest solution is to set the C: \ Users \ Administrator \ PhpstormProjects \ phpDemo permission to Everyone and allow full control:

Access the php page again:

The above method is simple enough, but it is too insecure. at ordinary times, it is okay to set up a local demo to do so. When it is actually online, this will happen sooner or later.

So I reset the settings and assigned the read-only permission under the directory to the NETWRORKSERVICE account. Try again.

However, the problem still persists. The 401 error occurred during access.

The error message shows that the logon user is anonymous, and the user has checked the identity authentication under the website (click "Anonymous Authentication"> "edit"). By default, when the logon method is anonymous, the default logon user is IUSR (that is, the anonymous logon user we see)

The solution is:

1. Set iusr to the read permission of C: \ Users \ Administrator \ PhpstormProjects \ phpDemo, similar to the previous NETWORKSERVICE settings.

2. Alternatively, you can use the application pool ID.

After testing, methods 1 and 2 are successful.

 

 

Note: NETWORKSERVICE is affiliated to the iis_iusers user group in IIS7. The previous NETWORKSERVICE settings can also be changed to iis_iusers settings. This can also solve the problem, but the permissions are further relaxed.

 

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: info-contact@alibabacloud.com 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.