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

Instalacion Windows 2008 y SQL 2008

Aspectos a tener en cuenta con IIS7.5 Instalar ASP.NET ow to install ASP.NET 1.1 with IIS7 on Vista and Windows 2008 Posted: Jun 02, 2008 21 comments Average Rating Tags Administration Administrators ASP.NET Compatibility Developers IIS7 Email this Post DotNetKicks Digg Facebook Del.icio.us BillS IIS Blog Contact Me Lots of new software... IIS 7.5 Launched with... ASP.NET 4 and Visual... Overview ASP.NET 2.0 (3.0 and 3.5) are easy to install with Windows Vista and Windows 2008 - just install the ASP.NET component located under IIS->Word Wide Web Services->Application Development Features. You can find this set of components in Windows 2008 by clicking Start , and click Server Manager . Expand the left-hand treeview in Server Manager and click Manage Roles , and then Web Server (IIS) . In the right-hand pane look for an option that says Add Role Services . If you're on Windows Vista, click Start , click Control Panel , click Programs , and then Windows Features . L...

OpenMeetings en Debian

Artículo tomado de  http://liberamemoria.blogspot.com/ Instalando OpenMeetings 0.7 RC 2 en Debian Lenny Mucho ha pasado desde mi último post y mucho más desde  aquel en que hablaba de OpenMeetings . Aprovechando la salida de  Debian 5.0  (Lenny para los amigos) y de  OpenMeetings 0.7 RC 2  reescribí dicho tutorial. Entre las mejoras notables de la nueva versión de OpenMeetings encontramos: Se puede incrementar el número de participantes en las salas desde la Administración hasta 1000 usuarios. Las ventanas de vídeo de los participantes se puede redimensionar. Desde el menú de Administración se puede expulsar usuarios. Se puede autenticar usuarios por LDAP. Como en el tutorial anterior, partimos de una instalación estándar de Debian Lenny sin entorno gráfico. 1) Instalación de Sun Java Development Kit Vamos a tener que habilitar los repositorios de la rama non-free de Debian Lenny. Para ellos editamos el archivo sources.list: # pico /etc/apt/sources.list Agregamos non-free a alguno de l...