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'