PHP5.3.5 官方下载:http://windows.php.net/downloads/releases/php-5.3.5-Win32-VC9-x86.zip
首先安装好IIS7 安装的时候 要注意三个地方打得勾
注: CGI 会在IIS7+PHP_5.3.5的环境中用到
下面开始添加IIS的PHP支持
1. 将下载回来的php_5.3.5解压到 C:\php目录(也可以放在其他地方,但是后面应该做相应修改)
2. 将php.ini-development改名为php.ini
3. 修改php.ini 查找data.timezone 修改为date.timezone = “Asia/Shanghai”(这里必须改,不然会出警告) 找到Windows Extensions开启 所需模块,如:php_curl.dll php_mysql.dll php_mysqli.dll php_xmlrpc.dll php_curl.dll 只要去掉前面的 分号 保存就可以了
4. 添加<模块映射>
这里的路径按你的实际情况填写.
5. 添加应用程序池
6. 另外,php.ini里面也要做些改动
■Set fastcgi.impersonate = 1. FastCGI under IIS supports the ability to impersonate security tokens of the calling client. This allows IIS to define the security context that the request runs under.
■Set cgi.fix_pathinfo=1. cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. Previously, PHP behavior was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not define PATH_INFO. For more information about PATH_INFO, see the cgi specifications. Setting this value to 1 will cause PHP CGI to fix its paths to conform to the specifications.
■Set cgi.force_redirect = 0.
■Set open_basedir to point to the folder or network path where the content of the Web site(s) is located.
■Set extension_dir to point to the location where the PHP extensions are located. Typically, for PHP 5.2.X the value would be set as extension_dir = “./ext”
7. 在网站根目录新建一个phpinfo.php的文本文件 内容为:
<?php
phpinfo();
?>
8. 测试,打开浏览器看结果:localhost/phpinfo.php,如果能看到类似下面的页面就说明你成功了:
好了,到现在 已经可以成功的运行PHP程序了.