Posted by arungupta
on August 24, 2007 at 6:07 AM PDT
Caucho Technology's 100% Java implementation of
PHP 5 . Ludo
described the steps to deploy PHP web applications on
GlassFish . Caucho has released a new
version of Quercus since then. This blog
entry is an update to the
steps described earlier .
- First, PHP-enable GlassFish.
quercus-3.1.1.war and copy the JAR files in "
directory to "
GLASSFISH_HOME/domains/domain/lib" directory. That's it!
Although the original entry requires to copy the JARs in "
directory but that
didn't work .
- Create a PHP web application
- Create a new Web application project, lets say "
using NetBeans IDE and choose
GlassFish as the server.
- Replace the contents of "web.xml" with the following fragment:
<?xml version="1.0" encoding="UTF-8"?>
<description>Caucho Technology's PHP Implementation, Running on GlassFish
Java EE 5</description>
This will declare PHP engine as the servlet.
- Add a new page "
index.php" in "
folder. The contents of the page are:
This page prints "Hello World!" on the browser and some
echo "Hello World!";
configuration settings of PHP. The directory structure of the created project looks like:
index.jsp" is only a template
file to get started with JSPs and "
is GlassFish-specific deployment descriptor. These files are
not required for this PHP application although it does not hurt to leave
them in the webapp as well.
- Deploy the application by right-clicking on the project and selecting "
". Your first PHP application in GlassFish is now deployed at
Now that you have verified that your GlassFish is ready to host PHP
applications, try the different applications that are described in
Ludo's blog .