WIn7安装PHP fastcgi for IIS

时间:2022-10-28 09:22:52
1、首先配置iis的fastcgi支持,开始-控制面板-程序-打开或关闭windows功能;
   WIn7安装PHP fastcgi for IIS
   选中cgi,点击确定,安装cgi(fastcgi);
2、安装并配置php,到http://windows.php.net/download/, 下载php for windows的zip包;解压缩zip包到c:\php目录,复制php.ini-production文件,并改名为php.ini;打开php.ini文件
   将一下行开始;去掉
     fastcgi.impersonate = 1
     cgi.fix_pathinfo = 1
     cgi.force_redirect = 0
     open_basedir  -- 设置你的web路径 (可以不设)
     extension_dir =  -- 设置扩展路径 (可以不设)

 3、配置iis,开始-运行-输入inetmgr-打开iis管理器-处理程序映射-添加模块映射
    WIn7安装PHP fastcgi for IIS
    注意选择可执行文件时,再打开窗口中选择.exe,默认是.dll

 4、建立站点

WIn7安装PHP fastcgi for IIS

 5、测试站点,创建test.php,输入 <?php echo "php配置成功" ?>,保存到php站点目录,重启IIS,打开浏览器,访问http://localhost:8080/test.php

 如果出现
    PHP Warning: phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.
  配置php.ini文件,去掉date.timezone 前面的 ; 并设置为date.timezone = Asia/Shanghai,重启IIS