0x000000ff php,Win7下通过FastCGI配置IIS7以执行php脚本

Name: PHP via FastCGI 3. Modify the Resuest Restrictions configuration: 4. Click OK . and 4. In the Add Module Mapping confirmation dialog box that asks if you want to create a FastCGI application for this executable, click Yes .\ 5. Test t

Name: PHP via FastCGI

test.jsp?url=http%3A%2F%2Fhi.csdn.net%2Fattachment%2F201111%2F2%2F0_1320223793D6iw.gif&refer=http%3A%2F%2Fblog.csdn.net%2FZevin%2Farticle%2Fdetails%2F6928973

3. Modify the Resuest Restrictions configuration:

test.jsp?url=http%3A%2F%2Fhi.csdn.net%2Fattachment%2F201111%2F2%2F0_1320224179AmSH.gif&refer=http%3A%2F%2Fblog.csdn.net%2FZevin%2Farticle%2Fdetails%2F6928973

4. Click OK. and 4. In the Add Module Mapping confirmation dialog box that asks if you want to create a FastCGI application for this executable, clickYes.\

test.jsp?url=http%3A%2F%2Fhi.csdn.net%2Fattachment%2F201111%2F2%2F0_1320224270E1iR.gif&refer=http%3A%2F%2Fblog.csdn.net%2FZevin%2Farticle%2Fdetails%2F6928973

5. Test that the handler mapping works correctly by creating a phpinfo.php file in the C:\inetpub\wwwroot folder that contains the following code:

6. Open a browser and navigate to http://localhost/phpinfo.php. If everything was setup correctly, you will see the standard PHP information page.

在这一步中,为了更加方便地检测Php是否安装成功,可以在cmd中,cd到c:\php目录下执行:php-cgi.exe D:\phpTest\test.php来验证。

test.jsp?url=http%3A%2F%2Fhi.csdn.net%2Fattachment%2F201111%2F2%2F0_1320224311FvXF.gif&refer=http%3A%2F%2Fblog.csdn.net%2FZevin%2Farticle%2Fdetails%2F6928973

NOTE: If you do not see FastCgiModule in theModules: list, the module is either not registered or not enabled. To check if the FastCGI module is registered, open the IIS configuration file that is located

at %windir%\windows\system32\config\applicationHost.config and check that the following line is present in the div:

In the same file, also check that the FastCGI module is added to the div:

Configure IIS 7 to handle PHP requests by using the command line

Alternatively, you can complete the steps above by using the command line tool AppCmd.

1. Create the FastCGI application process pool by running the following command:

C:\>%windir%\system32\inetsrv\appcmd set config /div:system.webServer/fastCGI /+[fullPath='c:\{php_folder}\php-cgi.exe']

2. Create the handler mapping by running the following command:

C:\>%windir%\system32\inetsrv\appcmd set config /div:system.webServer/handlers /+[name='PHP_via_FastCGI',path='*.php',verb='*',modules='FastCgiModule',scriptProcessor='c:\{php_folder}\php-cgi.exe',resourceType='Unspecified']

Note:If you are using PHP version 4.X, you can use php.exe instead of php-cgi.exe.

BTW, 在这个过程中,可能会遇到500错误:

Error info:

HTTP Error 500.0 - Internal Server Error

C:\PHP\php-cgi.exe - The FastCGI process exited unexpectedly

Detailed Error Information

Module: FastCgiModule

Notification: ExecuteRequestHandler

Handler: PHP via FastCGI

Error Code: 0x000000ff

Requested URL: localhost/test.php

Physical Path: C:\inetpub\wwwroot\test.php

Logon Method: Negotiate

Logon User: Domain\user

引起这个问题的关键还是php.ini文件的设置有问题,可以通过排除法来解决:直接到 c:\php目录下,双击PHP-CGI.EXE, 在弹出的命令行窗口下看具体是什么错误,然后相应地修改php.ini文件,清除掉(用;注释掉)无效的或者提示找不到的extensions,就可以使用了。

Try to execute PHP-CGI.EXE (BY DOUBLECLICKING ON IT). See if you get any error messages/ pop-ups. I got a ton of them and it all boiled down on having a bunch of extensions turned on, but not being available in my ext folder. Clear the PHP.INI of those invalid

extensions and the problem should go away.

本文原创发布php中文网,转载请注明出处,感谢您的尊重!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值