您的位置:首页 > 编程语言 > PHP开发

Windows2008 IIS7+PHP 5.3.5配置PHP图解

2012-08-14 14:32 288 查看
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程序了.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: