Tomcat running PHP

Source: Internet
Author: User
Tomcat running PHP
XML Code
In the tomcat installation directory, comment out the following code in 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 /*

In the tomcat installation directory, comment out the following code in 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 code
Server startup
Java. Lang. Security exception is prompted.
Org. Apache. Catalina. servlets. cgiservlet cannot be loaded.
Change context. XML to the following under Conf.
WEB-INF/Web. xml

Server startup
Java. Lang. Security exception is prompted.
Org. Apache. Catalina. servlets. cgiservlet cannot be loaded.
Change context. XML to the following under Conf.
WEB-INF/Web. xml
Java code
Create a new CGI directory in your project/Web-INF/According to the Web. xml configuration above and write
Helloworld. php
?>
Running browsing

Http: // localhost: 8080/project name/cgi-bin/Hello. php

Time
Php-cgi security exception and error

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 asWhyThis 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.

Written in version. php as follows:

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 asWhyThis 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.

Solution: php. ini
CGI. force_redirect = 1 to CGI. force_redirect = 0

Then restart the server to run it. I tested the running status of phpcms in Tomcat. It's okay and a little slow.

Short_open_tag = on. I also changed this. I forgot why I changed it to on.

Short_open_tag specifies whether the abbreviated form of the PHP code start sign can be used.
Yes
?> This method

My goal is to integrate discuz
This is a discuz Java interface.

Http://code.google.com/p/discuz-ucenter-api-for-java/

Php cms garbled

Http://bbs.phpcms.cn/viewthread.php? Tid = 110921

Modify the include/common. Inc. php file and find the following code:

If (gzip & extension_loaded ('zlib ') ini_set ('zlib. output_compression', 'on ');

Change 'on' to 'off'

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.