Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Apache Tomcat »

Re: How can we use php with tomcat

Reparto Tecnico - Assistenza

2007-01-09

Replies:

Le Phuoc Canh ha scritto:
> Can we use php with tomcat ?
> If anybody know about it, please help me.
>
> Thanks & Best Regard.
>
>  
  I have installed on my Tomcat 5.5.20 the PHP 4.0 ...

  there are 2 ways :
  1) using the famous php servlet  phpsrvlt.jar that requires
external libraries to work

  2) using the slow CGI-BIN PHP interpreter

  The second way is very simple , it requires only to add a few lines
on web.xml
> <!-- PHP-CGI Servlet Declaration -->
>      <servlet>
>           <servlet-name>php</servlet-name>
>      
> <servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
>           <init-param>
>                 <param-name>executable</param-name>
>                 <param-value>/var/www/sbin/php4.ELF</param-value>
>           </init-param>
>           <init-param>
>                 <param-name>debug</param-name>
>                 <param-value>1</param-value>
>           </init-param>
>           <init-param>
>                 <param-name>cgiPathPrefix</param-name>
>                 <param-value>.</param-value>
>           </init-param>
>           <load-on-startup>5</load-on-startup>
>      </servlet>
>
>      <!-- The mapping for the PHP-CGI servlet -->
>      <servlet-mapping>
>           <servlet-name>php</servlet-name>
>           <url-pattern>*.php</url-pattern>
>      </servlet-mapping>
>

  and install (on Debian) the PHP CLI package
  (CLI = Command Line Interpreter) .

  Hope this may help you  :-)

    Gabriele Burattini

------------------------------------------------------------------------

Le informazioni contenute nella presente e-mail e negli eventuali
allegati, devono essere nella disponibilita' del solo destinatario. Se
avete ricevuto per errore questa e-mail siete pregati di informarci
(rispedendola al mittente) e di provvedere alla sua rimozione. Possono
essere presenti informazioni riservate e non corrette (parzialmente o
totalmente). Le e-mail in partenza e in arrivo possono essere oggetto di
monitoraggio da parte di FaberSoft S.r.l. Del contenuto e' responsabile
il mittente della presente.

Chiunque venga in possesso non autorizzato di questa e-mail e' vincolato
dalla Legge a non leggerne il contenuto, a non copiarla, a non
diffonderla e a non usarla. La informiamo che per l'esercizio dei
diritti di cui all'art. 7 del D.Lgs. 196/2003 puo' rivolgersi al
Titolare del trattamento FaberSoft Srl per posta o per fax, indicando
sulla busta o sul foglio la dicitura "Inerente alla Privacy", o inviando
una e-mail all'indirizzo amministrazione@(protected) .

©2008 junlu.com - Jax Systems, LLC, U.S.A.