Home > Article > Backend Development > How to create a PHP file directory and set permissions on IIS
IIS (Internet Information Services) is a set of web server software developed by Microsoft and is widely used for website construction on Windows operating systems. However, when developing PHP applications, a series of configuration and permission settings are required to ensure that the website can function properly.
In this article, we will explore how to create a PHP file directory on IIS and set the correct permissions.
IIS creates PHP file directory
Before using IIS to build a PHP application, you need to install PHP. If you don’t have PHP installed yet, you can download the latest version from PHP’s official website. After installing PHP, you need to specify the PHP interpreter in IIS.
First, you need to install the FastCGI module in IIS. FastCGI improves the performance of PHP applications while reducing memory consumption on the server.
Before adding the FastCGI module, you need to know the path to PHP-cgi.exe on your computer. This file will be created when you install PHP.
In IIS, select the Application Pools tab, then right-click your application pool and select Advanced Settings. In Advanced Settings, find the Processor Mapping setting and click Add Module Mapping.
In the pop-up dialog box, select the FastCGI module. In the Module box, select Full path to FastCGI module, and in the Executable box, enter the full path to PHP-cgi.exe. When finished, click OK to save the settings and close the dialog box.
In IIS, create a folder named "PHP" and add a A PHP file named "index.php". This will be the home page of your PHP application.
Set PHP folder permissions
In IIS, the permissions to access the PHP folder require some additional settings.
In IIS, under "Default Website" or "Applications", create a new application. Point the application to the "PHP" folder you just created.
Right-click on your "PHP" folder, select the "Properties" option, and then go to "Security" Tab. Add the "Network Services" user group to the folder's access permissions list and set it to "Read and Execute" permissions.
Right-click on your "PHP" folder, select the "Properties" option, and then enter "Security" Tab. Add "Anonymous IIS User" to the folder's access permissions list and set it to "Read and Execute" permissions.
Conclusion
With the above steps, you can create the PHP file directory on IIS and set the correct permissions. This will ensure that your PHP application functions properly and provides a seamless experience to your users.
The above is the detailed content of How to create a PHP file directory and set permissions on IIS. For more information, please follow other related articles on the PHP Chinese website!