linuxzone

Registered
Jun 12, 2004
4
0
151
Hi,

I have integrated the apache with tomcat successfully and all my jsp files are now working fine on port 80 but not php files.

In my httpd.conf I have given like this

<IfModule mod_jk.c>
JkMount /* ajp13
</IfModule>

But: Apache then does not serve PHP anymore (they get routed to Tomcat).
When I try to access any php files,it comes with a download box.But the same file is working fine outside the tomcat.

Our application uses both java and php.How can I make my php files work with tomcat.

Regards,
 

linuxzone

Registered
Jun 12, 2004
4
0
151
Got solution..

Hi,

I found the solution.

1. Recompile Php with

./configure --with-servlet=$TOMCAT_HOME --with-java=$JAVA_HOME


2. A jar file and dynamic library are produced from the make (sapi/servlet/phpsrvlt.jar and libs/libphp4.so)

Copy the jar file to your web application's class repository, or, alternately, to Tomcat's common class repository.

cp $PHP_HOME/sapi/servlet/phpsrvlt.jar $TOMCAT_HOME/common/lib

3.Declare PHP servlet and servlet-mapping in the web applications web.xml file, or in Tomcat's shared web.xml

Copy from $PHP_HOME/sapi/servlet/web.xml the servlet and servlet-mapping and paste into the file $TOMCAT_HOME/conf/web.xml.

4. Modify your LD_LIBRARY_PATH to include the dynamic library produced

LD_LIBRARY_PATH=$PHP_HOME/libs
export LD_LIBRARY_PATH

This fixed the issue for me :) :) .

Thanks & Regards,