Instructions for setting up Tomcat 6 and PHP 5 as a portable distribution: What you need: - Tomcat 6, zip distribution (http://tomcat.apache.org/) - I used 6.0.18 (apache-tomcat-6.0.18.zip) - PHP 5, zip distribution - I used 5.2.9-1 (php-5.2.9-1-Win32.zip) - PECL - The latest time as of this writing is 5.2.6. However, this version does not include the necessary servlet extensions, so you will need 5.2.5. (pecl-5.2.5-Win32.zip) - Java - I used the 1.6.0u12 JDK. I think a normal JRE will also work. 1. Choose a directory to keep everything in. I used C:\tomcat_php\. I wil refer to this as BASE_DIR 2. Unzip the Tomcat distribution to BASE_DIR. Rename the apache-tomcat-6.x directory to tomcat6 3. Unzip PHP to BASE_DIR\php5 4. Install the JDK. Copy C:\Program Files\Java\jdk1.6.0_xx to BASE_DIR. Rename it to jdk1.6.0 At this point, you should have a directory structure which looks roughly like this: C:\ | tomcat_php\ | | jdk1.6.0\ | | php5\ | | tomcat6\ 5. In BASE_DIR\php5, copy php.ini-dist to php.ini 6. Edit php.ini. Find the Dynamic Extensions section and add extension=php_java.dll at the bottom of it 7. Extract php5servlet.dll from the PECL zip to BASE_DIR\php5. Rename it to php5srvlt.dll 8. Extract php_java.dll from the PECL zip to BASE_DIR\php5\ext 9. Create a directory named phptest in BASE_DIR\tomcat6\webapps. 9. Extract phpsrvlt.jar from the PECL zip to phptest\WEB-INF\lib (using the phptest directory you just created) 10. Create web.xml in phptest\WEB-INF with the following contents: php net.php.servlet php-formatter net.php.formatter php *.php php-formatter *.phps 11. Create index.php in phptest with the following contents: 12. Create startup.bat in BASE_DIR with the following contents: @echo off setlocal for %%x in (%0) do set BatchPath=%%~dpx for %%x in (%0) do set BatchDrive=%%~dx cd /d %BatchPath% set PATH=%BatchPath%php5;%PATH% set JAVA_HOME=%BatchPath%jdk1.6.0 cd tomcat6\bin startup.bat 13. Create shutdown.bat in BASE_DIR with the following contents: @@echo off setlocal for %%x in (%0) do set BatchPath=%%~dpx for %%x in (%0) do set BatchDrive=%%~dx cd /d %BatchPath% set PATH=%BatchPath%php5;%PATH% set JAVA_HOME=%BatchPath%jdk1.6.0 cd tomcat6\bin shutdown.bat 14. Everything should now be set up. Use startup.bat and shutdown.bat to start and stop Tomcat. With Tomcat started, you should be able to visit http://localhost:8080/phptest/index.php in a web browser and get a PHP info page.