Ir al contenido principal

PHP On Tomcat

Fue tomado de http://fabien.duminy.ifrance.com/blog/archives/2007/08/entry_14.html

tomcat and php

Here are the steps to run php in tomcat :

  1. Download tomcat and unzip the archive where you want (=> TOMCAT_DIR)
  2. Create the following directories : TOMCAT_DIR/webapps/testPHP
  3. If necessary, create directory TOMCAT_DIR/common/lib (it seems, at least with tomcat 6, that the directory is no more created)
  4. Edit the file TOMCAT_DIR/conf/catalina.properties and modify the line for property shared.loader :
    shared.loader=${catalina.home}/common/classes,${catalina.home}/common/lib/*.jar
  5. Edit the file TOMCAT_DIR/conf/web.xml and add the lines mentionned below (see 'lines to add to web.xml of your tomcat installation')
  6. To download quercus ( a php 5 engine written in pure java), you must in fact download resin because quercus can't be downloaded separately
  7. Unzip the archive to RESIN_DIR
  8. Copy the 2 files RESIN_DIR/lib/resin-util.jar and RESIN_DIR/lib/quercus.jar to the directory TOMCAT_DIR/common/lib (see step 3)
  9. Now, in the directory TOMCAT_DIR/webapps/testPHP, create a file named test.php with the following content :
  10. start tomcat (TOMCAT_DIR/bin/startup.sh) if you have not already done
  11. Enter the following url in your web browser : http://localhost:8080/testPHP/test.php
  12. You should get a screen like the following (values may vary) :
------------ expected result screen ---------------------------------

Quercus

PHP Version => 5.2.0
System => Linux 2.6.20-16-generic amd64
Build Date => 20070628T2777
Configure Command => n/a
Server API => CGI
Virtual Directory Support => disabled
Configuration File (php.ini) Path => WEB-INF/php.ini
PHP API => 20031224
PHP Extension => 20041030
Debug Build => no
Thread Safety => enabled
Registered PHP Streams => php, file, http, https

PHP Variables

............
----------------------------------------------------------------
------------ lines to add to web.xml of your tomcat installation ---------
quercus
com.caucho.quercus.servlet.QuercusServlet
text/html
quercus
*.php
----------------------------------------------------------------
And Voila, you have a running php engine in your tomcat webserver :-)

Comentarios

Publicar un comentario

Debes estar registrado en el blog para poder enviar tus comentarios.

Entradas populares de este blog

Vulnerabilidad en Bluetooth -- BIAS

instalar FEDORA 9 en VirtualPC

Para instalar Fedora 9 en virtualPC se obtuvo ayuda desde la pagina web  http://blogs.technet.com/seanearp/archive/2008/05/19/installing-fedora-9-sulphur-in-virtual-pc-2007.aspx Installing Fedora 9 (Sulphur) in Virtual PC 2007 Fedora 9 was released last week, which you can download here: http://fedoraproject.org/get-fedora.html .  What's new?  Highlights from the release notes include: GNOME 2.22 . GNOME now includes a webcam photo and video creation utility called Cheese , improved network filesystem support, a new international clock applet, Google Calendar support and custom email labels in Evolution, a new Remote Desktop Viewer, improved accessibility features, and PolicyKit integration. KDE 4.0.3 Xfce 4.4.2 NetworkManager 0.7 provides improved mobile broadband support, including GSM and CDMA devices, and now supports multiple devices and ad-hoc networking for sharing connections. The Fedora installer, Anaconda , now supports partition resizing for ext2...

Comandos en Linux sin mucha fama

En linux existen muchos comandos que ni siquiera sabemos que existen o que en algún momento vimos o ejecutamos y ahora no recordamos, he querido hacer una lista de 10 de los tantos en este post: (algunos requerirán elevar privilegios o ser root) 1 .  ctrl+x +e Con este juego de teclas se puede abrir rápidamente el editor de texto, dependiendo de cual se tenga configurado, nano, vi, vim etc. 2.   ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq /tmp/prueba.mpg Captura video desde el escritorio de Linux y lo almacena en la carpeta /tmp con el nombre de prueba.mpg, muy útil para generar videos sencillos. 3. sudo !! Ejecuta el último comando como root, generalmente. 4. python -m SimpleHTTPServer Habilita un servidor HTTP por el puerto 8000 la ruta donde esté parado en el momento, por ejemplo, si usted se ubica en /opt y ejecuta este comando puede ver a través de http lo que tiene ese directorio. http://localhost:8000. 5. cp filename{,.bak} Co...