tomcat 运行php_tomcat运行php

tomcat运行php Xml代码 tomcat安装目录下conf/web.xml把下边这段代码注释去掉 cgi org.apache.catalina.servlets.CGIServlet debug 0 cgiPathPrefix WEB-INF/cgi passShellEnvironment true executable E:\Program Files\PHP\php-cgi.exe 5 cgi /cgi-bin/* tomcat安装目录下conf/web.xml把下边这段代码注释去掉 cgi org.apache.catalina.servlets.CGIServlet debug 0 cgiPathPrefix WEB-INF/cgi passShellEnvironment true executable E:\Program Files\PHP\php-cgi.exe 5 cgi /cgi-bin/* Java代码 服务器启动 会提示安全java.lang.安全Exception 说不能加载 org.apache.catalina.servlets.CGIServlet 到conf 下Context.xml改为下边 WEB-INF/web.xml 服务器启动 会提示安全java.lang.安全Exception 说不能加载 org.apache.catalina.servlets.CGIServlet 到conf 下Context.xml改为下边 WEB-INF/web.xml Java代码 新建一个根据上边web.xml配置的在你的工程/web-inf/ 新建一个cgi目录,写个 helloworld.php 运行浏览 http://localhost:8080/工程名/cgi-bin/hello.php 的时候 php-cgi自己的安全异常又报错

This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive.

For more information as to why this behaviour exists, see the http://php.net/security.cgi-bin ">manual page for CGI security.

For more information about changing this behaviour or re-enabling this webserver, consult the installation file that came with this distribution, or visit http://php.net/install.windows ">the manual page. 那个version.php里这样写的:

This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive.

For more information as to why this behaviour exists, see the http://php.net/security.cgi-bin ">manual page for CGI security.

For more information about changing this behaviour or re-enabling this webserver, consult the installation file that came with this distribution, or visit http://php.net/install.windows ">the manual page. 解决办法 php.ini中 cgi.force_redirect = 1 改为 cgi.force_redirect=0 然后重启服务器运行就可以了。我测试了phpcms在tomcat运行情况,还行,有点慢 short_open_tag = On 还改了这,忘了因为什么改成On了 short_open_tag规定了是否可以使用PHP代码开始标志的缩写形式 就是 这种方式 我的目的是为了整合discuz 这是个discuz java 接口 http://code.google.com/p/discuz-ucenter-api-for-java/ php cms乱码问题 http://bbs.phpcms.cn/viewthread.php?tid=110921 修改include/common.inc.php 文件,找到如下代码: if(GZIP && extension_loaded('zlib')) ini_set('zlib.output_compression', 'On'); 把 'On' 改成 'Off'

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值