Configure iis to support PHP, ISAPI, CGI, and FastCGI (1/4)

Source: Internet
Author: User

In the php Tutorial of configuring isapi in iis6 of windows server 2003, the configuration method is to add a new web service extension in iis's "web service extension, the program suffix is php, and the isapi program is php5isapi. dll, and then add the variable name phprc to my computer-> Properties-> Advanced-> "environment variable"-"system variable". The value is php. ini path. In internet information service manager, select the root directory of the website or application, open the directory properties Page (right-click and select "properties"), and then select "main directory ". Click the "configuration" button and select the "ing" tab. Click "Add... in the "executable file", set it to c: phpphp5isapi. dll, with the extension set. php, select "check whether the file exists", and then "OK" to save the settings. Restart the server to complete the php configuration.


The above Red part does not need to be done, because the isapi is used with php, and the system variable is not read (read only in cgi mode). The related permission settings are as follows:
<Configure the read permission for "iusr _ ***" in the folder where the webpage is located. If you want to write, modify the permission.
Configure the read permission for "network service" and "iusr _ ***" in the PHP file folder.
Php. Ini file to "network service" read permission
To obtain the dll file in the system32 directory, you must grant "iusr _ **" Read and run permissions.
Decompress the php binary package to the d: php directory.
Choose "My Computer"> "properties"> "advanced"> "environment variables"> "system variables"> "path" to edit the value, add the following path
Address:
; D: php; d: phpext (note the semicolon above)

When using iis to integrate php, there are two methods: isapi and cgi mode. We can see the phpinfo page in both methods, but the isapi mode cannot read environment variables, therefore, php is set through the environment variable phprc. the ini path cannot be found. You can use cgi to copy many files to the system file.


The configuration file (php3.ini in php 3 and php. ini from php 4) is read at php startup. For php of the server module version
The web server is read once at startup. For cgi and cli versions, each call will read.
The search path for php. ini is as follows (in order ):
* Position specified by the sapi module (phpinidir command in apache2,-c command line option in cgi and cli, nsapi
The php_ini parameter in, and the php_ini_path environment variable in thttpd)
* Hkey_local_machinesoftwarephpinifilepath (windows Registry location)
* Phprc environment variables
* Current working directory (for cli)
* Web server directory (for sapi module) or php Directory (for other windows scenarios)
* Windows directory (c: windows or c: winnt), or the location specified by the -- with-config-file-path option during compilation

I met this problem in the server2003 + php4 environment. The solution is to add a phprc when writing the path environment variable, pointing to x: php4php. ini, restart it. If it still doesn't work, the last step is to install the zend and php accelerators, because when zend is installed, php will be specified. the ini path also specifies whether the server is iis or apache. In essence, the registry is modified, but I don't know where to change it, so when the above operation is still invalid, I finally installed zend and finally solved the problem.

Homepage 1 2 3 4Last page

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.