jboss5.0.1Ga with php
muhammad_sohail Dec 22, 2009 2:19 AMsteps for making php run on jboss application server on WINDOWS XP Operating System.
1. Download & Extract Jboss Application server on to a local drive(say C:\ drive ).
2. Download & Extract php5servlet-windows-i586-SP1.zip(the PHP module) to C: drive.
3. Created a folder “php5” under C:
4. copied c:\php5servlet-windows-i586-SP1\PHP\* to c:\php5.
(now “php5” folder has a “bin” folder inside it).
5. Made a copy of the C:\php5\bin\php.ini-recommended to %WINDIR%\php.ini. (%WINDIR% is nothing but C:\WINDOWS)
6. Opened %WINDIR%\php.ini and changed extension_dir value to c:/php5/bin/ext/.
7. Edited the jboss-5.0.1.GA\server\default\deploy\jbossweb.sar\server.xml
(Added the following lines in the server.xml)
<Listener className="org.jboss.web.php.LifecycleListener"/>
8. Edited the jboss-5.0.1.GA\server\default\deployers\jbossweb.deployer\web.xml to work with the php servlet .
(Added the following lines in web.xml)
<servlet-name>php</servlet-name>
<servlet-class>org.jboss.web.php.Handler</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<load-on-startup>6</load-on-startup>
<servlet-name>phps</servlet-name>
<servlet-class>org.jboss.web.php.Highlight</servlet-class>
<servlet-mapping>
<servlet-name>php</servlet-name>
<url-pattern>*.php</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>phps</servlet-name>
<url-pattern>*.phps</url-pattern>
</servlet-mapping>
10. Added one line in the <welcome-file-list> element:<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.php</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
11. I have set the environment variables:
JAVA_HOME=<PATH TO YOUR JDK INSTALLATION>
PHP_HOME=c:\php5 PATH=%PATH%;%JAVA_HOME%\bin;%PHP_HOME%\bin;%PHP_HOME%\bin\ext;
And jboss-5.0.1.GA\server\default\deployers\jbossweb.deployer, has jbossweb-extras.jar
12. I have created a simple php script <?php phpinfo(); ?> in index.php file and have copied it under .\server\default\deploy\ROOT.war
13 The most important thing is that when we download php5servlet-windows-i586-SP1 it contains the phpservlet.dll in php/bin for working with catalina.apache
when we edit/add lines for jboss such as org.jboss.web.php we need to change the phpservlet.dll
i download the corrected phpservlet.dll for jboss..simply download it and put it into php5servlet-windows-SP1-i586\PHP\bin
file is attach with it
i hope this will solve the sapiclass problem
-
php5servlet.zip 7.0 KB