Running PHP with Quercus in Jetty Web ServerTomcat and Jetty are very similar. Jetty can be invoked and installed as a stand alone application server. It has a flexible component based architecture that allows it to be easily deployed and integrated in a diverse range of instances. The project is supported by a growing community. The Jetty team has a history of being responsive to innovations and changing requirements. More info here. Installing JettyFirst you need to download Jetty. It’s distributed as a platform independent zip file containing source, javadocs and binaries. The most recent distro can be downloaded from Codehaus: $ wget http://dist.codehaus.org/jetty/jetty-6.1.14/jetty-6.1.14.zip Problems installing Jetty? More info here. Running JettyRunning jetty is as simple as going to your jetty installation directory and typing: $ cd /opt/jetty This will start jetty and deploy a demo application available at: http://localhost:8080/test That’s it. Now stop Jetty with cntrl-c in the same terminal window as you started it. Installing QuercusQuercus is a complete implementation of the PHP language and libraries in Java. It gives both Java and PHP developers a fast, safe, and powerful alternative to the standard PHP interpreter. Quercus is available for download as a WAR file which can be easily deployed on Jetty: $ wget -P ~/quercus http://quercus.caucho.com/download/quercus-3.2.1.war Unpack the WAR file and copy all the jars to Jetty’s global library directory: $ cp ~/quercus/WEB-INF/lib/* /opt/jetty/lib Configuring JettyEdit the web.xml file: $ vi /opt/jetty/webapps/test/WEB-INF/web.xml Add the following between the web-app tags: <servlet> Create a PHP file inside the test application: $ cat /opt/jetty/webapps/test/index.php This file will be available at: http://localhost:8080/index.php It works! You are now ready to: Instantiate objects by class name <?php Import classes <?php Call Java methods <?php And much, much more. |
Active forum topics
Current jobs
No job postings to display
Who's new
Poll
|










