PHP Runtime file system permissions problems and solutions in a fastcgi way

Source: Internet
Author: User
Tags anonymous file system

In the IIS7.0 on the fastcgi way to configure the PHP operating environment, the test can normally run the PHP program, the PHP program to deploy, import the original data and configuration information. It's going to be a problem. Let's write down the details below.

Today you are ready to put a PHP demo running under IIS, and the Web site is configured like this under IIS:

The application pool is the. NET Framework 2.0 (2.0 or 4.0) in Integrated mode, because PHP is running in a fastcgi way, the application pool identity is configured as a built-in IIS NetworkService, and authentication is used for anonymous authentication.

Open a local Web site, access to the PHP page, there are 500 errors.

Well, it's a permissions issue, and the simplest solution is to set the C:usersadministratorphpstormprojectsphpdemo permissions to everyone and allow Full Control:

Re-access to the PHP page, successful:

The above method is simple enough, but also too unsafe, usually local to take a demo this do no problem, really on the line, so sooner or later the problem.

Then reset, the directory read-only permission assigned to the Netwrorkservice account and try again

However, the problem was not resolved, when the visit, there were 401 errors

The error message includes displaying the logged-in user as anonymous, checking the authentication under the Web site (and then clicking Anonymous Authentication-> Edit), the original web site by default, when the login method is anonymous, use the default login user for IUSR (that is, we see the anonymous logged-in user)

So the solution is:

1. Set IUSR to C:usersadministratorphpstormprojectsphpdemo Read permissions, similar to the previous settings for NetworkService.

2. Or choose to use the application pool identity.

After trial, methods 1 and 2 were successful.

Note:networkservice in IIS7 subordinate to the Iis_iusers user group, before the NetworkService settings can also be changed to the iis_iusers settings, the same can also solve the problem, but the permissions have been further relaxed.

The above is the entire contents of this article, I hope you can enjoy.

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.