1 2 3 4 Previous Next 49 Replies Latest reply on Apr 28, 2010 12:51 PM by Peter Johnson

    jboss AS, jboss Web and php

    nitzan tomer Newbie

      hi,

      i'm new to the whole jboss experience and i'm a bit confused with what exactly "jboss web" is all about...

      what i want to achive is to be able to use the jboss AS for the logical part of my web application while using php for the view part.
      from what i read, the jboss web supports php but i'm not sure of how to integrate it with the jboss AS.

      as for right now i have jboss AS 4.2.2 installed and running (on a windows XP machine).
      what should i do that will enable the use of php?

      thanks a lot, nitzan.

        • 1. Re: jboss AS, jboss Web and php
          Peter Johnson Master

          See the discussion at [url]http://www.jboss.com/index.html?module=bb&op=viewtopic&t=121051[/ur]. Though some are the specific issues discussed are Linux-related, the general 'how to get php running in jbossas' portion applies to XP as well.

          • 2. Re: jboss AS, jboss Web and php
            nitzan tomer Newbie

            thanks for your reply.

            i read the thread you pointed at, but i'm afraid that it's not what i'm looking for...
            the main thing that i'm looking for is the JBoss Application Server and not the JBoss Web.
            i only want the JBoss Web in order to use php (and url rewriting might be nice as well).

            now, i'm still a bit confused about all of this, can i just add the JBoss Native to the JBoss AS? will that do the trick for me?

            thanks, nitzan.

            • 3. Re: jboss AS, jboss Web and php
              Peter Johnson Master

              That thread is about getting PHP to run on JBossAS. As indicated there, the steps are to install JBoss Native, and then install the PHP package from http://labs.jboss.com/jbossweb/downloads/php/. It worked for me.

              • 4. Re: jboss AS, jboss Web and php
                nitzan tomer Newbie

                hi,

                i'm still having a problem with php in JBoss AS 4.2
                i did try to follow everything that was said in the thread i was directed to, and other pages i could find but it does not help.

                i get this exception:
                The PHP Native library which allows executing PHP scripts was not found on the java.library.path
                and the cause is:
                java.lang.UnsatisfiedLinkError: Can't find SAPI class, no libphp5servlet in java.library.path

                here's what i did so far (i hope i remember it all):
                - installed JBoss AS 4.2.2
                - added the JBoss Native 2.0.1 to the JBoss AS directory (bin\native)
                - downloaded the php5servlet-windows-SP1-i586 file and moved the PHP folder to another location
                - moved the php.ini to the windows directory
                - edited the server\default\deploy\jboss-web.deployer/server.xml and server\default\deploy\jboss-web.deployer\conf/web.xml to work with the php servlet
                - downloaded the jbossweb-extras.jar and placed it in all kind of places (server\default\deploy\jbossws.sar, JBOSS_HOME/lib, server\default\lib, JBOSS_HOME\bin\native)

                no matter what i do i get this exception.. what i really dont understand is this so called "SAPI class".. i cant find any file called "libphp5servlet", i understand that the linux version of the php have a file called "libphp5servlet.so" but i dont have a windows equivalent.. so i guess that it's not a big suprise that it cant find it...
                am i missing something?

                thanks a lot, nitzan.

                • 5. Re: jboss AS, jboss Web and php
                  Peter Johnson Master

                  The error message is written in Unixese. In Windows, the missing file is php5servlet.dll, and it should be in the bin/native directory. When you unpack the zip download http://labs.jboss.com/jbossweb/downloads/php/, copy the file from the PHP/bin directory to bin.native.

                  • 6. Re: jboss AS, jboss Web and php
                    nitzan tomer Newbie

                    thanks a lot for your help peter.

                    i tried what you wrote but it doesnt help.
                    i still get the same error message even when php5servlet.dll is in bin\native.

                    any other ideas of what might the problem be?
                    thanks a lot!
                    nitzan.

                    • 7. Re: jboss AS, jboss Web and php
                      Peter Johnson Master

                      When the app server starts, it prints the value of JAVA_OPTS, and one of those options should be -Djava.library.path="...". Make sure that the bin/native directory, and the php directory (the one that has all of the php-related dlls) are in that list.

                      Another thing to try is open the php5servlet.dll with the depends utility (one of the XP support tools). This utility will chase down the dlls on which php5servlet depends to ensure that all of them are in the PATH (for me it says that dwmapi.dll is missing, but apparently it is not needed).

                      • 8. Re: jboss AS, jboss Web and php
                        nitzan tomer Newbie

                        peter,

                        i checked the JAVA_OPTS and the following directories:
                        - bin/native
                        - php/bin
                        - php/bin/ext
                        are included there

                        as for the "depends utility", i couldnt find a windows version of this so i downloaded "Dependency Walker" which does the same..
                        it says that my dwmapi.dll is missing as well but other than that it looks a ok.

                        what else can cause the problem?
                        thanks a lot for all your help, nitzan.

                        • 9. Re: jboss AS, jboss Web and php
                          nitzan tomer Newbie

                          oh, another question:
                          i used the service.bat that comes with the jboss-native to run the jboss AS as windows service.
                          this works great but only for local host.
                          i know that i should use the -b option when using run.bat (run -b 0.0.0.0) but i do i make it run as windows service like this?

                          thanks.

                          • 10. Re: jboss AS, jboss Web and php
                            jaikiran pai Master

                             

                            "nitm" wrote:
                            oh, another question:
                            i used the service.bat that comes with the jboss-native to run the jboss AS as windows service.
                            this works great but only for local host.
                            i know that i should use the -b option when using run.bat (run -b 0.0.0.0) but i do i make it run as windows service like this?

                            thanks.


                            In the service.bat file edit the following

                            call run.bat >run.log


                            to

                            call run.bat -b 0.0.0.0 >run.log


                            Restart your service after changing this file.

                            • 11. Re: jboss AS, jboss Web and php
                              nitzan tomer Newbie

                              ok, that did the trick.. now the server runs outside localhost as well..
                              thanks!

                              any ideas on the php problem?

                              • 12. Re: jboss AS, jboss Web and php
                                Peter Johnson Master

                                If the dependency walker did not notice any missing DLLs, then it should work. I have some other ideas, but my php-enabled setup is at work and I am at home, and I want to try them out first to see if they help (or even work) before suggesting them. So I will have to set up php at home. This will take a day or two.

                                But while I do that, a few more questions (my apologies if you already answered these and I missed them):
                                what version of the JDK are you using?
                                where did you install the jdk (what is JAVA_HOME set to)?
                                where did you install jbossas? (full path)

                                • 13. Re: jboss AS, jboss Web and php
                                  nitzan tomer Newbie

                                  peter, thanks a lot for all your help, i really appreciate it!

                                  here's the info of the server:

                                  jdk: there are two jdks on the computer: jdk1.5.0_14 and jdk1.6.0_03
                                  the JAVA_HOME is set to: jdk1.5.0_14 (C:\Program Files\Java\jdk1.5.0_14)

                                  jboss: i'm using jboss-4.2.2.GA and the JBOSS_HOME is set to: C:\Program Files\jboss\application-server\jboss-4.2.2.GA

                                  • 14. Re: jboss AS, jboss Web and php
                                    Peter Johnson Master

                                    Take both the JDK and JBossAS out of Program Files. Paths with spaces in them tends to give some Java code fits. I have mine installed at c:\apps\jdk1.5.0_13 and c:\opt\jboss\jboss-4.2.2.GA. You do not have to re-install the JDK - simply move it to the new location and adjust JAVA_HOME accordingly.

                                    Please verify that JBossAS is using the 1.5 JVM (and not 1.6); look for a message in the console log similar to the following:

                                    16:56:39,265 INFO [ServerInfo] Java VM: Java HotSpot(TM) Server VM 1.5.0_12-b04,Sun Microsystems Inc.

                                    1 2 3 4 Previous Next