Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

Declare PHP servlet and servlet-mapping in your or tomcat's common web.xml:

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

Modify your LD_LIBRARY_PATH to include the dynamic library produced in step 1 above:

  • LD_LIBRARY_PATH=$PHP_HOME/libs
  • export LD_LIBRARY_PATH
    5.

Start tomcat:

  • $TOMCAT_HOME/bin/startup.sh.

...

Testing

...

  • Create a file named test.php in the docBase directory of your webapp.

...

  • In that file, simply put:
    +++
    <?php phpinfo(); ?>
    +++

...

...

Wiki Markup
This is a patch for PHP's configure script to account for the servlet jar name change (from servlet.jar in Servlet Spec 2.3 and previous \[tomcat 4 and previous\] to servlet-api.jar in Servlet Spec 2.4 and above \[tomcat 5 and later\]):

...