tomcat運行php

來源:互聯網
上載者:User
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'
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.