It is easy to configure PHP on iis. You only need to make a few settings to complete iis integration php settings! The following describes how to integrate php in iis:
Decompress the PHP package to a certain location, generally C: \ PHP
Set php. ini-dist is renamed as php. ini, put it in the C: \ windows Directory, pay attention to php. ini permission. If the VM sets the permission to remove the users in the windows directory, copy the previous php. ini has no permission, and all dll files cannot be loaded.
Modify extension_dir = "C: \ php \ ext" in php. ini to set the path for storing the extended dll file in PHP.
Create a directory for storing sessions, such as sessions.
Modify session. save_path = C: \ php \ sessions in php. ini to set the session to be stored in the specified directory.
Create a temporary directory for storing the uploaded files, for example, temp (the parent directory of this directory must have the permission for the column folder, otherwise there will be permission issues)
Modify upload_tmp_dir = "C: \ php \ temp" in PHP. ini"
Read Permissions for users in the PHP Directory and users in the sessions directory and temp directory
Change output_buffering = Off TO output_buffering = On, and enable output buffering.
After enabling the service, you can resolve some website opening errors or opening gaps without affecting other normal websites.
-----------------------------------------------------------------
When common extensions are enabled, remove the semicolon before extension = XXX. dll.
Below are common extensions
Extension = php_curl.dll
Extension = php_gd2.dll; used for image processing, such as slice scaling and watermarks
Extension = php_mbstring.dll; required by phpmyadmin
Extension = php_mcrypt.dll
Extension = php_mhash.dll
Extension = php_mssql.dll; required by sqlserver
Extension = php_mysql.dll; required by mysql
Extension = php_mysqli.dll; Same as above
Extension = php_pdo.dll
Extension = php_pdo_mssql.dll
Extension = php_pdo_mysql.dll
Extension = php_pdo_sqlite.dll
-----------------------------------------------------------------
ISAPI method:
In the web service extension of IIS, add an extension pointing to the C: \ php \ php5isapi. dll file and set it to allow
In IIS, Add. php extension points to C: \ php \ php5isapi. dll (either the CGI method or the dll method)
Add users read permission to the PHP Directory
Add the users read permission to the entire PHP Directory (in fact, you only need to add the network service permission). If you use the ISAPI mode, you need this permission, and CGI does not need it.
In this way, the c: \ windows \ php. ini file must have the read permission for the network service.
CGI Mode:
In the web service extension of IIS, add an extension pointing to the C: \ php \ php-cgi.exe file, set to allow
In IIS, add the. php extension to d: \ php \ php-cgi.exe in website-home directory-configuration-application extension (either with ISAPI method, not recommended)
Add users read permission to the PHP Directory
Set cgi. force_redirect = 0 in php. ini. If this value is not set, the default value is 1, and CGI must be set to 0.
-----------------------------------------------------------------
Support for mysql
In addition to enabling the php_mysql.dll extension, you must also copy libmysql. dll under the PHP Directory to c: \ windows \ system32.
Supports MSSQL (optional)
In addition to enabling php_mssql.dll extension, copy the ntwdblib. dll file to c: \ windows \ system32.
Note: The version of this file in PHP is incorrect and cannot be connected. You must use the version of the ntwdblib. dll file in the installation directory of the connected SQL Server.
2000 the database has requirements on the dll file version. If it is set to 2005, it seems that any version of The dll can be connected.
-----------------------------------------------------------------
Support curl
In addition to enabling curl extension in php. ini, you must put the libeay32.dll and ssleay32.dll files in the system32 folder.
-----------------------------------------------------------------
Support for mcrypt
In addition to enabling the mcrypt extension in php. ini, you must also put libmcrypt. dll in the system32 folder.
-----------------------------------------------------------------
Other settings are usually left unchanged by default. You can set them again when necessary.
Post_max_size = 8 M; default value: 8 M
Upload_max_filesize = 2 M; default value: 2 M
Enable global variables
Register_globals = Off disabled by default
Increase timeout limit
Max_execution_time = 30 The default value is 30 seconds.
Or set other content.
After completing the above steps, if you can open the php page, it indicates that the php configuration is successfully integrated under your iis.