1. Add \php to the PATH environment variable. I assume you know how to do this.
2. Set up PHP configuration file. First rename \php\php.ini-recommended to \php\php.ini. Then edit \php\php.ini to set the following values:
cgi.force_redirect = 0
doc_root = "c:\inetpub\wwwroot"
cgi.redirect_status_env = ENV_VAR_NAME
3. Create a new environment variable PHPRC with \php. This is needed to access php.ini.
4. Now we need to change IIS configuration to run PHP scripts as CGI scripts. Run Control Panel, Internet Information Service, Default Web Site, and Properties. On the Directory tab, first set Execute Permissions to "Scripts only". Then click Configuration to add a new Application Mapping with Executable=\php\php-cgi.exe, Extension=.php, and Script engine checked.
5. Stop and start Default Web Site.
6. Copy Hello.php to \inetpub\wwwroot.
No comments :
Post a Comment