Install JBoss Web 1.0.1 GA with PHP Servlet 5.1.6

Table of contents


JBoss Web Server is an enterprise ready web server designed for medium and large applications, based on Tomcat.
JBoss Web Server provides organizations with a single deployment platform for Java Server Pages (JSP) and Java Servlet technologies, PHP, and CGI. It uses a genuine high performance hybrid technology that incorporates the best of the most recent OS technologies for processing high volume data, while keeping all the reference Java specifications.


Download and install Sun's JDK.

Download & Unpack

  1. Download the JBossWeb Win32 zipped archive [ 27 Mb ]
  2. Download the native Win32 PHP module archive [ 8 Mb ]

Extract the archives

  1. Extract to the root of your C: drive (i.e. C:\jbossweb-1.0.1.GA)
  2. Extract to the root of your C: drive (i.e. C:\php5servlet-windows-SP1-i586)
  3. Move the folder C:\php5servlet-windows-i586-SP1\PHP to C:\php5
  4. Make a copy of the file C:\php5\bin\php.ini-recommended to C:\%WinDir%\php.ini
  5. Open C:\%WinDir%\php.ini with a text editor and change extension_dir value to "C:/php5/bin/ext/".
    If you want to use PHP short tag <? you need to change short_open_tag value to On

Configure the PHP Module


Open the file C:\jbossweb-1.0.1.GA\server\default\deploy\jbossweb.sar\server.xml and uncomment the following line

<Listener className="org.apache.catalina.servlets.php.LifecycleListener"/>

you may modify the default port the server will be listening to, here on port 8080

<Connector protocol="HTTP/1.1" port="8080" address="${jboss.bind.address}"
   redirectPort="8443" xpoweredBy="true"/>


Open the file C:\jbossweb-1.0.1.GA\server\default\deploy\jbossweb.sar\conf\web.xml and uncomment the PHP servlet definition

<!-- The PHP servlet definition -->

uncomment the mapping for the PHP servlet

<!-- The mapping for the PHP servlet -->

and add the <welcome-file>index.php</welcome-file> line in the welcome file list


Check your Windows Environment Variables

Windows Environment Variables
Variable Value
PHP_HOME C:\php5
PATH %PATH%;%JAVA_HOME%\bin;%PHP_HOME%\bin;%PHP_HOME%\bin\ext

Time to run!

  1. Create a file named test.php in the folder C:\JBossWeb\server\default\deploy\jbossweb.sar\ROOT.war

    If you plan to deploy a php webapp, you'll need to pack it in a regular WAR file/folder. JBoss will deploy it like a java webapp.

  2. Edit the created file with your favorite editor and add the following code
  3. The file C:\jbossweb-1.0.1.GA\bin\run.bat will run the server within a console. Check for any error message!
  4. Et voilà! Check the installation via the JMX-CONSOLE or via http://localhost/test.php!

Use C:\jbossweb-1.0.1.GA\bin\service.bat if you want to setup JBossWeb as a windows service.