9 Replies Latest reply on Dec 17, 2009 9:33 AM by Alex Alex

    How to install PHP on JBoss 4.0.3SP1 (Linux)?

    Alex Alex Newbie

      Hi Everyone,

      First of all, I was wondering if anyone was able to install PHP module on JBoss 4.0.3SP1 (Linux)? Is it at all possible or is an upgrade to version 4.2.x+ required?

      I looked at a number of threads here, but hit the wall trying to get it to work.

      I downloaded JBoss native from http://www.jboss.org/jbossweb/downloads/jboss-native/?action=a&windowstate=maximized and extracted the package to jboss-4.0.3SP1/bin directory.

      I also grabbed PHP module from http://www.jboss.org/jbossweb/downloads/php/?action=a&windowstate=maximized and extracted it to jboss-4.0.3SP1 directory.

      I then tried to follow the instructions on this page http://www.jboss.org/file-access/default/members/jbossweb/freezone/modules/php/index.html, but there is no 'jbossweb.sar' in server/default directory. Instead, there's jbossweb-tomcat55.sar which does have server.xml in it, but there's no line mentioned at the above URL ( that contains Classname='org.apache.catalina.servlets.php.LifecycleListener'). There is nothing at all containing 'php' in that file.

      Any suggestions as to how to proceed would be highly appreciated. Please note that I am a n00b to JBoss, so please be as detailed as possible in your answer.

      Thank you.

        • 1. Re: How to install PHP on JBoss 4.0.3SP1 (Linux)?
          Peter Johnson Master

          I haven't used PHP with JBoss AS 4.0.x. All of the instructions I have seen are for 4.2.0 and higher. I imagine that you could possibly install PHP for use with 4.0.3SP1 - take a look at how it is done for 4.2.3 (and get it working with 4.2.3) and mimic that in 4.0.3.

          By the way, I don't think that installing JBoss Native is a requirement (but I could be wrong).

          By the way, is there a reason you need to use 4.0.3 and cannot use a more recent version?

          I am also wondering if Quercus might work for you.

          1 of 1 people found this helpful
          • 2. Re: How to install PHP on JBoss 4.0.3SP1 (Linux)?
            Alex Alex Newbie

            Hi Peter,

            I did look at 4.2.x instructions and got stuck because the directories are different in 4.0.3 and server.xml does not contain entries mentioned in the instructions for 4.2.x.

            This is a corporate server and they are pretty anal about any sort of upgrades, but I will try to communicate with the IT team to see if it can be done.

            I will also look at Quercus.

            Thanks for your help.

            • 3. Re: How to install PHP on JBoss 4.0.3SP1 (Linux)?
              Alex Alex Newbie

              Got a reply from IT. "No JBoss upgrade for you". Trying to get Quercus to work...


              I downloaded quercus-4.0.2.war and kind of stuck again. If I FTP the .war file to /deploy directory on JBoss, it shows up as a file, not a container/directory. Is there a command I need to run to make it work? Any help would be appreciated

              • 4. Re: How to install PHP on JBoss 4.0.3SP1 (Linux)?
                Peter Johnson Master
                A WAR file is often a simple ZIP file - what I do is change the name to quecus.war.zip and then use a zip utility to extaract the contents into a quercus.war directory. I then populate that directory with my PHP files and copy the whole thing to the deploy directory.


                I really suggest doing this on a local copy of JBoss AS before trying it out on the "global" one on the Linux server.

                1 of 1 people found this helpful
                • 5. Re: How to install PHP on JBoss 4.0.3SP1 (Linux)?
                  Alex Alex Newbie
                  Thanks, I was able to add quercus.war directory to /deploy per your instructions, but it's not accessible via http://server.com/quercus/index.php URL ("Page not Found"). War containers with JSP files are accessible. I wonder if there's additional configuration required to make it work.
                  • 6. Re: How to install PHP on JBoss 4.0.3SP1 (Linux)?
                    Peter Johnson Master

                    Did you download and install Quercus 4.0.2?

                    There is no additonal configuration required - it works as-is out of the box.

                    Were there any messages displayed on the console log (I sure hope you are doing this on you local box...)?

                    I also hope you are using JDK 5, Quercus requires it.

                    • 7. Re: How to install PHP on JBoss 4.0.3SP1 (Linux)?
                      Alex Alex Newbie

                      I am working on test server. Yes, I downloaded quercus-4.0.2.war, renamed to zip, extracted into quercus.war directory, then FTP'd over to test server. Log entry shows this:


                      2009-12-14 17:24:03,673 DEBUG [org.jboss.deployment.MainDeployer] Starting deployment of package: file:/usr2/home/pephp/jboss-4.0.3SP1/server/pephp/deploy/quercus.war/


                      2009-12-14 17:24:29,096 DEBUG [org.jboss.deployment.MainDeployer] End deployment start on package: quercus.war
                      2009-12-14 17:24:29,096 DEBUG [org.jboss.deployment.MainDeployer] Deployed package: file:/usr2/home/pephp/jboss-4.0.3SP1/server/pephp/deploy/quercus.war/

                      • 8. Re: How to install PHP on JBoss 4.0.3SP1 (Linux)?
                        Alex Alex Newbie

                        Here's java version information:

                        java version "1.5.0_11"

                        Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)

                        Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_11-b03, mixed mode)

                        • 9. Re: How to install PHP on JBoss 4.0.3SP1 (Linux)?
                          Alex Alex Newbie

                          Ok, I kind of... sort of... got it to work. But I am not quite where I want to be yet. I'm having hard time because I wasn't the one who did the JBoss install/config on test server, and I have no means of reaching that person right now.


                          Anyway, what I found was that there's a bunch of war archives in the jboss/server/username/deploy folder, but only one of them accessible via the web -- working.war had an index.html and a bunch of jsp files in it and can be accessed via http://server/working/.


                          So I took the quercus.war content and placed it into that directory and added code from quercus' xml file to web.xml in that WAR archive. index.php was placed in the root of working.war. First, I could not access http://server/working/index.php in any manner, receving 404 'page not found' error. Other (jsp) files and the index.html were accessible as before. I kept at it, restarting the server, checking XML files to see if there is any configuration option that needs to be changed.


                          I went to /jboss/server/username/work/jboss.web/localhost and found 'working' folder with 'org' subdirectory and tldCache.ser file. I renamed the 'org' directory to 'temp' and that caused some kind of reset in 'working.war' because all of the sudden http://server/working/ was pointing to index.php instead of index.html. Not only that, index.php was actually rendered properly -- "Congratulations!  Quercus™ Open Source 4.0.1 is interpreting PHP pages.  Have fun!".


                          Here's the interesting part... http://server/working/index.php returns '404-page not found' error, but http://server/working/ points to index.php located in the root of working.war. Index.html which is also in the root of working.war is accessible via http://server/working/index.html. I don't quite understand why it works this way. I'm guessing there are multiple instances of jboss running and there's configuration options that need to by modified/added somewhere on the server. I'll keep fiddling around trying to get it to work and hopefully to figure out why only one .war folder is accessible via the web.


                          If anyone has any suggestions, they'd be highly appreciated.