出错提示:Security Alert! The PHP CGI cannot be accessed directly. This PHP CGI binary was compiled

修改php.ini将cgi.force_redirect设为0,然后重起IIS

---------------------------------------------------------------

除了楼上的可能外,Apache默认目录权限未配置也会造成该提示生效。
修改Apache Conf目录httpd.conf

1<directory></directory>

Options None
AllowOverride All
Order allow,deny
Allow from all 把PHP配置成二进制CGI绑定
ScriptAlias /php/ "d:/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"

若不想配置成CGI方式,可以用模块方式配置
LoadModule php4_module d:/php/sapi/php4apache.dll
AddModule mod_php4.c
AddType application/x-httpd-php .php

注意根据你机器中的路径修改!

Published At
Categories with Web编程
Tagged with
comments powered by Disqus