<b>配置windows server 2008的iis7.0支持fastcgi运行php(终究订正</b>[服务器安全]
本文“<b>配置windows server 2008的iis7.0支持fastcgi运行php(终究订正</b>[服务器安全]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:
事情是这样的.我的电脑在C盘装的是XP,E和F盘装的是WINDOWS SERVER 2008.用来做服务器的是F盘的WINDOWS SERVER 2008.在XP系统下,我直接安装了Appserv套件,包含PHP,MYSQL,PHPMYADMIN,安装途径为D盘.而目前预备在F盘的 WINDOWS SERVER 2008系统下配置IIS7.0以支持fastcgi运行PHP.
当然,像前文所述,在服务管器中增添支持fastcgi的功效.
然后,去http://www.php.net/download下载一份最新版的non-thread safe zip package.解压到我的D盘的Program Files下的PHP目录.
目前就是配置IIS 7.0了.翻开IIS管理掌握台,新建一个站点,名称为PHPHOME.当然,由于我将其端口绑定为80,故应先改正已有的那个站点Default Web Site所绑定的端口(改成8080吧). 途径为我放在D盘www途径下的PHP程序.注意:利用程序池选DefaultAppPool.以下图,请看细心各个配置:
然后单击PHPHOME,双击右边的处理程序映射(Handler Mappings),点击右边呈现的操作中的“增添模块映射(Add Module Mapping...)”,以下配置各个项目:
点击肯定.假如提醒不成功,可以把“可履行文件”下面的途径加上双引号括起来,再点确认.
- Request path: *.php
- Module: FastCgiModule
- Executable: "C:\[Path to your PHP installation]\php-cgi.exe"
- Name: PHP via FastCGI
点击默许文档,增添index.php
还得注意的是:
1.安装MYSQL.由于我XP已在D盘安装过MYSQL,故这里直接共用那个程序.运行,CMD,翻开号令行,输入:d:\Progra~1\Appserv\Mysql\BIN\MYSQLD-NT.EXE --INSTALL,回馈的后果是已经安装MYSQL服务.注:这个号令其实就是运行安装MYSQLD-NT.EXE.
2.配置PHP及PHPMYADMIN.
-
- Rename the php.ini-recommended to php.ini.Open the php.ini file, then uncomment and modify settings as follows:
- 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. PHP's previous behavior was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not care what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting this to 1 will cause PHP CGI to fix its paths to conform to the spec
- Set cgi.force_redirect = 0.
- Set open_basedir to point to a folder or network path where the content of the web site(s) is located.
- Set extension_dir to point to a location where PHP extensions reside. Typically, for PHP 5.2.X that would be set as extension_dir = "./ext"
- Enable the required PHP extension by un-commenting corresponding lines, for example:
extension=php_mssql.dll
extension=php_mysql.dll
以上英文大约有些人看得不太懂,扼要翻译一下.
粗心是在D盘的PHP目录中把php.ini-recommended改成php.ini,翻开,改正里面的各项配置:
改正 fastcgi.impersonate = 1,cgi.fix_pathinfo=1,cgi.force_redirect = 0,改正open_basedir 为d:\www(既PHP程序存放的途径),改正extension_dir为extension_dir = "./ext",删去extension=php_mssql.dll
extension=php_mysql.dll前的分号.
假如对php.ini较熟,可以安闲改正别的选项.
重启机械后PHP应当就可以运行了.
还需配置PHPMYADMIN:
我的直接在D:\WWW途径下,
配置config.inc.php,找到以下代码并做呼应改正
$cfg['PmaAbsoluteUri'] = ''; //PhpMyadmin途径,如我的为:localhost
$cfg['blowfish_secret'] = ''; //随便输几个字母
$cfg['Servers'][$i]['auth_type'] = 'config'; //config或http改成cookie
$cfg['Servers'][$i]['password'] = ''; //输入安装数据库时的密码OK.
注意:假如phpmyadmin显示
无法载入 mcrypt 扩大,<br />请查抄 PHP 配置
办理办法:
1>:找到D:\program files\appserv\Php5\libmcrypt.dll(此文件具体位置按照你的安装位置),复制到X:\WINDOWS\system32文件夹(X为SERVER2008的安装分区)
2>:重新启动IIS.还有不懂的可以参照下面的视频:
http://learn.iis.net/page.aspx/375/setting-up-fastcgi-for-php/
注:得先安装silverlight才能傍观.silverlight的功效就像支持flash一样,是一种新的流媒体播放器.
校园网速不好,可以下载来看.
http://download.microsoft.com/download/3/c/a/3ca6a2de-5060-494d-a8a4-ed45088c24c2/final_6.wmv
这里举荐用SOGOU浏览器,加度还好.
本文地址: | 与您的QQ/BBS好友分享! |