Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP on Tomcat 8

I had found quite a few guides how to make PHP run on Tomcat, but all were on previous versions. I tried all of them and all I could manage to display is a blank page and the code is still not fired.

I understand that Tomcat is build for Java application and not PHP, but I need to find a way to do that with Tomcat 8. Does any of you know a resource that could help me with this? I tried the guides in the following links, but without luck:

http://tojackwu.blogspot.com/2008/10/php-5-on-tomcat-6-installation.html

http://php-java-bridge.sourceforge.net/doc/tomcat6.php

Any idea if this is possible with Tomcat 8 and how can I do it?

OS: Windows;

like image 315
user2227904 Avatar asked Dec 17 '13 12:12

user2227904


2 Answers

Your best bet to run PHP on top of Tomcat is probably to download and install the Quercus WAR file. Quercus is a Java-based implementation of PHP 5, and it can be found at http://quercus.caucho.com/.

like image 185
Brian Showalter Avatar answered Sep 28 '22 22:09

Brian Showalter


Please follow the guide from: http://php-java-bridge.sourceforge.net/pjb/webapp.php

The above has been verified in TomEE, which is based on Tomcat

Note that Tomcat 8 still contains a bug. As a workaround you'll need to add an empty "java" directory to the JavaBridgeTemplate.war zip file:

drwxr-xr-x         0  31-Oct-2010  15:24:24  WEB-INF/
-rw-r--r--       239  31-Oct-2010  15:20:30  WEB-INF/weblogic.xml
drwxr-xr-x         0  31-Oct-2010  15:24:24  WEB-INF/lib/
-rw-r--r--    436954  31-Oct-2010  15:24:24  WEB-INF/lib/JavaBridge.jar
-rw-r--r--     58673  31-Oct-2010  15:24:24  WEB-INF/lib/php-script.jar
-rw-r--r--     58252  31-Oct-2010  15:24:24  WEB-INF/lib/php-servlet.jar
-rw-rw-r--      3871  31-Oct-2010  15:24:50  index.php
-rwxrwxr-x        19  31-Oct-2010  15:24:50  test.php
-rw-rw-r--      1779  31-Oct-2010  15:24:50  WEB-INF/web.xml
drwxr-xr-x         0  25-Apr-2016  20:53:10  java/
like image 40
user1135940 Avatar answered Sep 28 '22 21:09

user1135940