tomcat支援php(EXTJS2.0.2)

來源:互聯網
上載者:User

extjs文檔中tree檔案夾下的reorder.html和two-trees.html等例子,因為節點的內容為php所有在tomcat下無法查看。

所以我們需要讓tomcat支援php:

1.baidu 下載 PHP 5.3.8 for Windows

地址:http://xiazai.zol.com.cn/detail/4/38877.shtml

2.在環境變數設定中的Path中加入php的路徑,例如: D:\soft\php-538

3.複製一份php.ini-development 將他的名字修改為php.ini 就可以了。

PS:  baidu文檔中說需要加入:extension_dir ="D:\software\php442\extensions" cgi.force_redirect = 0   我沒有加入也可以。

4.將D:\apache-tomcat 5.5\server\lib\servlets-cgi.renametojar 複製一份,修改名字為servlets-cgi.jar

5.在tomcat的web.xml中加入過濾器,其中修改 executable的值為php.exe的路徑

 <!--  php --> <servlet>        <servlet-name>cgi</servlet-name>        <servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>        <init-param>          <param-name>clientInputTimeout</param-name>          <param-value>100</param-value>        </init-param>        <init-param>          <param-name>debug</param-name>          <param-value>0</param-value>        </init-param>        <init-param>          <param-name>cgiPathPrefix</param-name>          <param-value>WEB-INF/..</param-value>        </init-param><init-param>   <param-name>executable</param-name>   <param-value>D:/soft/php-538/php.exe</param-value>   </init-param>         <load-on-startup>5</load-on-startup>    </servlet>    <servlet-mapping>        <servlet-name>cgi</servlet-name>        <url-pattern>*.php</url-pattern>    </servlet-mapping> <!-- end hankjin php -->

6.修改extjs2中的get-nodes.php檔案,最開頭修改為

<?phpecho "\n\n";// from php manual page

原來沒有php和 echo"\n\n"

OK !

以上內容為本人實踐,可行!

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.