Hi to all,

Mladen discussed about using PHP from Tomcat.

Jean-Frederic Clere make some tests during his vacation
and send me the following mail to be forwarded to the list :

....

Good news, tomcat+php it's easy, php allready have support for.
I make a simple try and here's the resulting 'readme' :
++++
Using php in Tomcat5: Easy a servlet is available in php (I have tried with
php-4.3.5)

configure the php with:
./configure --with-servlet=$TOMCAT_HOME --with-java=$JAVA_HOME
a jarfile and dynamic library are produced:
- sapi/servlet/phpsrvlt.jar
- libs/libphp4.so

Copy jarfile and arrange web.xml:
cp $PHP_HOME/sapi/servlet/phpsrvlt.jar $TOMCAT_HOME/common/lib
copy the $PHP_HOME/sapi/servlet/web.xml servlet and servlet-mapping in the
$TOMCAT_HOME/conf/web.xml

Start the Tomcat:
LD_LIBRARY_PATH=$PHP_HOME/libs
export LD_LIBRARY_PATH
$TOMCAT_HOME/bin/catalina.sh start

Try it:
Create a file named ./webapps/ROOT/test.php containing:
+++
<?php phpinfo(); ?>
+++
Call it:
http://localhost:8080/test.php

Patch for the configure of php:

--- configure.org       2004-04-07 11:20:24.000000000 +0200
+++ configure   2004-04-07 11:22:50.000000000 +0200
     if test "$withval" = "yes"; then
       SERVLET_CLASSPATH=.
     else
+      if test -f $withval/common/lib/servlet-api.jar; then
+        SERVLET_CLASSPATH=$withval/common/lib/servlet-api.jar
+      fi
+
       if test -f $withval/lib/servlet.jar; then
         SERVLET_CLASSPATH=$withval/lib/servlet.jar
      fi
++++



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to