一、环境
windows server 2003R2 tomcat8 PHP5 MySQL5
很多文档要求将server/lib下servlets-cgi改名为servlets-cgi.jar。从6版本以后,好像就没有server目录,内部已经自动支持cgi,只需要进行配置即可。
Tomcat需要JDK 1.6以上,所以JDK需要先安装好。
二、配置步骤:
1、到C:\php-5.3.10-Win32-VC9-x86目录下将php.ini-development复制一份同一目录下,命名为php.ini
<1>设置extension_dir参数:
extension_dir="C:\php-5.3.10-Win32-VC9-x86\ext"
<1>设置cgi.force_redirect参数:
cgi.force_redirect = 0
2、修改tomcat配置文件
<1>修改conf/web.xml,找到并将cgi的servlet和servlet-mapping的注释去掉
<2>修改conf/context.xml
<3>修改默认网站根目录conf/server.xml
connectionTimeout="20000" redirectPort="8443" /> unpackWARs="true" autoDeploy="true"> 建立index.php文件 http://10.0.1.11:8080/index.php 不出意外应该能看到PHP的测试页 本文参考 http://blog.csdn.net/ge_zhiqiang/article/details/6602511 http://www.cnblogs.com/top5/archive/2012/11/29/2794036.html
三、测试
上一篇:php设计模式之——原型模式
下一篇:tingkphp快速创建项目