Download the jbossweb-extras.jar using following URL
http://anonsvn.jboss.org/repos/jbossreflex/trunk/php/jbossweb-extras.jar
This jar file contains the Listeners for the PHP, move this jar file to $JBOSS_HOME/server/<your_server>/deploy/jboss-web.deployer directory.
[ JBOSS_HOME in the sense that Location of your Jboss ex: /usr/jboss-4.2.0.GA in Linux].
In the same Location get the server.xml file and edit it, add the following Listener code to that file <Listener classname="org.jboss.web.php.LifecycleListener"/>
Then move to $JBOSS_HOME/server/
<servlet>
<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>
<servlet>
<servlet-name>phps</servlet-name>
<servlet-class>org.jboss.web.php.Highlight</servlet-class>
</servlet>
<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>
Then download the .so [Shared Object] files for PHP in order make PHP as servlet from the following URL,
http://download.jboss.com/jbossweb/modules/php/php5servlet-linux-i686-1.0.2.tar.gz
Uncompress it,
]# tar -zxf php5servlet-linux-i686-1.0.2.tar.gz
So you will get php5servlet-linux-i686-1.0.2 directory contains a single directory named PHP. we are going to map this directory to JBOSS AS so for naming convention make “php5servlet-linux-i686-1.0.2/PHP” as “PHP” by using
]# mv php5servlet-linux-i686-1.0.2/PHP PHP
Now you have the location of this PHP directory which contains *.so files. Goto $JBOSS_HOME/bin directory and edit run.conf file and add the following lines to set the library path for the downloaded *.so files.
LD_LIBRARY_PATH=
export LD_LIBRARY_PATH
Restart your server now and make execute your php files.
NOTE:
- $JBOSS_HOME is your location of JBOSS AS for example /usr/jboss-4.2.0.GA
- You can also Download files using wget URL of the file ex: ]# wget http://anonsvn.jboss.org/repos/jbossreflex/trunk/php/jbossweb-extras.jar
M.Ramkumar[ராம்குமார்]
1 comment:
Thanks for the walkthrough. The only question I have is where is the php.ini file? How do I edit php settings?
Thanks so much!
Post a Comment