Friday, June 18, 2010

Tomcat6 running PHP applicatoins: Can it be done?

Simply, Yes it can be done.

Download PHP-Java Bridge (http://php-java-bridge.sourceforge.net/), install it and your away.

Also, it doesn't work. It takes all day to set up the configuration and still runs pretty buggy.

By "doesn't work" I mean, to run Tomcat6 (because you already have it installed) on you windowsXP laptop to serve up PHP files straight from you eclipse workspace in order to develop and test a pure PHP app which is intended to run in a vanilla PHP production system, "doesn't work".

Why not? Well it sets the PHP session.save_path to the temp directory that Tomcat is intended to use, which is not a bad thing, except that it leaves in the single quotes. So you end up with a session.save_path of (for example) "'C:\WINDOWS\Temp'\sessions" (including the single quotes).

This then doesn't work.

You can spend half a day screwing with it but it will just end in frustration.

My suggestion.
Spend 2 minutes downloading the Apache2.2.x server MSI and then run it.
Spend another 2 minutes downloading the PHP5.x.x MSI and run it (even if you have PHP installed, rerun the installer) and select to configure with Apache2.2.
Spend 21 seconds changing the Apache Document Root to be your workspace path.
Then restart Apache.

Total for the day:
Screwing with Tomcat6 and PHP-Java Bridge - 5 hours.
Creating a fully functional dev enviroment with Apache2.2.x - 2 minutes, 21 seconds.

2 comments:

Oliver said...
This comment has been removed by the author.
Oliver said...

I used quercus on a glassfish.
1. Get Glassfish
2. Deploy quercus.war
3. Place the PHP-App in domains\domain1\applications\quercus-4.0.3

It takes about 30 min.
One problem unsolved: It is not possible to use the PDFlib, because something is wrong with the font loading.