Ir al contenido principal

PHP On Tomcat

Fue tomado de

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/ and modify the line for property shared.loader :
  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/ 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 ---------------------------------


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 ---------
And Voila, you have a running php engine in your tomcat webserver :-)


Entradas populares de este blog

25 Useful IPtable Firewall Rules Every Linux Administrator Should Know

Tomado de network traffic is one of the toughest jobs a system administrators has to deal with. He must configure the firewall in such a way that it will meet the system and users requirements for both incoming and outgoing connections, without leaving the system vulnerable to attacks.25 IPtables Firewall Rules for LinuxThis is where iptables come in handy. Iptables is a Linux command line firewall that allows system administrators to manage incoming and outgoing traffic via a set of configurable table rules.Iptables uses a set of tables which have chains that contain set of built-in or user defined rules. Thanks to them a system administrator can properly filter the network traffic of his system.Per iptables manual, there are currently 3 types of tables:FILTER – this is the default table, which contains the built in chains for:INPUT  – packages destined for local socketsFORWARD – packets routed through …

Problemas de ASP error 0115

Cuando saca este error 

Páginas Active Servererror 'ASP 0115'
Error inesperado/iscampus/admon/upload/upload_dest.aspError capturable (C0000005) en un objeto externo. La secuencia de comandos no puede continuarFue solucionado de la siguiente manera:
W2K3 tiene tiene limitada a 200 K el tamaño de los ficheros que pueden subirse con ASP, y se debe modificar el archivo C:\WINDOWS\system32\inetsrv\metabase.xml elvalor asignado a la entrada spMaxRequestEntityAllowed por el necesario.  Puede ser 10 MB.Para poder modificar el archivo es necesario parar el servicio IIS y configurar en la administracion de IIS en equipo Local click derecho, propiedades  activamos el checkbox que dice "Habilitar la modificación directa de archivos Metabase".Tambien puede ser necesario hacer lo siguiente:What does this error mean: 'error "ASP 0115" Unexpected error - A trappable error occurred in an external object.'It typically means that you are not running the latest version o…