Background: The company website needs an online customer service system, so choose Open Source Mibew, Baidu Encyclopedia here. Since Mibew is written in PHP, the company's Web site uses JSP. To facilitate the same port (8080), it is decided to integrate the PHP environment into TOMCAT.
Software Description: JDK 1.8.0.25/apache Tomcat 7.0.59/php version 5.6.8/mibew 1.6.14/mariadb 10.0.17 (a derivative version of MySQL)
JAR file used: Javabridge.jar Php-servlet.jar Php-script.jar
Step one, modify the Mibew source code.
Find/lib/config.php Modify the current database link information.
Step two, move the directory.
Move the Mibew folder here to "D:\apache-tomcat-7.0.59\webapps\ROOT\WEB-INF" ...
Step three, configure TOMCAT.
1. Move Javabridge.jar Php-servlet.jar Php-script.jar three files to "D:\apache-tomcat-7.0.59\lib" ...
2. Unzip the downloaded PHP to the root directory of TOMCAT.
3, modify the php.ini file (I am directly from the XAMPP integration environment of the copy, I believe that I write this thing, will download and install PHP--#)
Find Cgi.force_redirect, remove comments, change to → cgi.force_redirect = 0
4, modify the Tomcat/conf/context.xml.
Add →privileged= "True" to the Context root node. Other unchanged
5, modify the Tomcat/conf/web.xml.
Add content as follows:
<servlet> <Servlet-name>Php</Servlet-name> <Servlet-class>Org.apache.catalina.servlets.CGIServlet</Servlet-class> <Init-param> <Param-name>Clientinputtimeout</Param-name> <Param-value>200</Param-value> </Init-param> <Init-param> <Param-name>Debug</Param-name> <Param-value>0</Param-value> </Init-param> <Init-param> <Param-name>Executable</Param-name> <Param-value>D:\apache-tomcat-7.0.59\php\php-cgi.exe</Param-value> </Init-param> <Init-param> <Param-name>Passshellenvironment</Param-name> <Param-value>True</Param-value> </Init-param> <Init-param> <Param-name>Cgipathprefix</Param-name> <Param-value>Web-inf/mibew</Param-value> </Init-param> <Load-on-startup>5</Load-on-startup> </servlet> <servlet-mapping> <Servlet-name>Php</Servlet-name> <Url-pattern>/mibew/*</Url-pattern> </servlet-mapping>
View Code
Step four, start TOMCAT.
Enter this in the browser's address bar: Http://localhost:8080/mibew/xxxxxxxxxxx can access the ~
PASS: What? Not going to work? Download good mibew inside there is a thing called README.txt ~
What? Can't read English? You have to switch off the browser.
The first time to write something, there are shortcomings, I hope you come in late in the audience leave a comment ~
Under Tomcat, use port 8080 to run the PHP project.