二,配置步骤:
1,到C: \ php-5.3.10-Win32-VC9-x86目录下将php.ini-development复制一份同一目录下,命名为php。ini
& lt; 1祝辞设置extension_dir参数:
extension_dir=" C: \ php-5.3.10-Win32-VC9-x86 \ ext "
& lt; 1祝辞设置cgi。force_redirect参数:
cgi.force_redirect =,
0
2,修改tomcat配置文件
& lt; 1在修改conf/网络。xml,找到并将cgi的servlet和servlet映射的注释去掉
,,& lt; servlet>
,,,,& lt; servlet-name> cgi
,,,,& lt; servlet-class> org.apache.catalina.servlets.CGIServlet
,,,,& lt; init-param>
,,,,,& lt; param-name> debug
,,,,,& lt; param-value> 0 & lt;/param-value>
,,,,& lt;/init-param>
& lt; init-param>
, & lt; param-name> executable
, & lt; param-value> C: \ php-5.3.10-Win32-VC9-x86 \ php-cgi.exe
& lt;/init-param>
, & lt; init-param>
, & lt; param-name> passShellEnvironment
, & lt; param-value> true
& lt;/init-param>
,,,,& lt; init-param>
,,,,,& lt; param-name> cgiPathPrefix
,,,,,& lt; param-value> - inf/. . & lt;/param-value>
,,,,& lt;/init-param>
,,,,,& lt; load-on-startup> 5 & lt;/load-on-startup>
,,& lt;/servlet>
,,& lt; servlet-mapping>
,,,,& lt; servlet-name> cgi
,,,,& lt; url-pattern> * .php
,,& lt;/servlet-mapping>
,,& lt;连接器端口=" 8080 "协议=癏TTP/1.1”
,,,,,,,,connectionTimeout=" 20000 "
,,,,,,,,redirectPort=" 8443 "/祝辞
,,,& lt;主机名=發ocalhost”, appBase=皐ebapps”
,,,,,,unpackWARs=" true " autoDeploy=" true "在
& lt;上下文路径=" " docBase=案鵟 web - inf \ php-bin " debug=" 0 "可写=" true "在
& lt;/Context>
三、测试
建立指数。php文件
& lt; ?php phpinfo(); ?在
http://10.0.1.11:8080指数。php
不出意外应该能看到php的测试页
本文参考
http://blog.csdn.net/ge_zhiqiang/article/details/6602511 http://www.cnblogs.com/top5/archive/2012/11/29/2794036.html