1 2 3 4 Previous Next 49 Replies Latest reply on Apr 28, 2010 12:51 PM by peterj Go to original post
      • 30. Re: jboss AS, jboss Web and php
        billzhou

        Hi, Peter.
        I am working on to make php working with Jboss enterprise platform 4.3. I got following error message in my log.
        14:06:25,428 ERROR [ContainerBase] StandardWrapper.Throwable
        java.lang.UnsatisfiedLinkError: /opt/apps/jboss-eap-4.3/jboss-as/bin/native/libphp5servlet.so: libmysqlclient_r.so.14: cannot open shared object file: No such file or directory, no libphp5servlet in java.library.path(/opt/apps/jboss-eap-4.3/jboss-as/bin/native)
        at org.jboss.web.php.Library.(Library.java:65)
        at org.jboss.web.php.Library.initialize(Library.java:104)
        at org.jboss.web.php.Handler.init(Handler.java:104)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4069)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4366)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:732)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
        at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
        at org.apache.catalina.core.StandardContext.init(StandardContext.java:5300)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)

        Here are the config I have:
        under /opt/apps/jboss/bin/native directories:
        -rwxrwxrwx 1 jbossadm jbossadm 21052692 2008-07-18 14:02 libphp5.so
        -rwxrwxrwx 1 jbossadm jbossadm 20351 2008-07-18 14:02 libphp5servlet.so

        under /opt/apps/jboss/PHP/lib, all libs are there.
        my run.conf file has exported the lib directory:
        #PHP setting

        export LD_LIBRARY_PATH=/opt/apps/jboss-eap-4.3/jboss-as/PHP/lib;

        The OS is RedHat Linux 64bit , jboss version is jboss elap 4.3

        Any assistance is appreciated.

        Thanks,

        Bill

        • 31. Re: jboss AS, jboss Web and php
          peterj

          The LD_LIBRARY_PATH needs to include the native directory (that's where the missing libphp5servlet is located).

          You have a 64-bit OS. Are you also running a 64-bit JVM, in which case do you also have the 64-bit version of the PHP library? The PHP library and JVM must match.

          • 32. Re: jboss AS, jboss Web and php
            johnnythehun

            Do not forget to have .NET framework installed on your system!
            The new phpservlet.dll depends on msvrt80.dll.

            • 33. Re: jboss AS, jboss Web and php
              mladen.turk

              Peter,

              What were the changes you made for the php5servlet?
              Was it just a new build or you fix something?

              Regards
              Malden

              • 34. Re: jboss AS, jboss Web and php
                peterj

                I don't thnik that I changed anything. The php5servlet.dll supplied must have been compile with old sources and still referred to an old package name. The sources I downloaded contained the correct package name and after compiling them worked without issue. That is why I never raised a JIRA - the fix was already there, it just had to be packaged and released.

                See http://www.jboss.org/index.html?module=bb&op=viewtopic&t=125437&postdays=0&postorder=asc&start=10#4116059

                • 35. Re: jboss AS, jboss Web and php
                  mladen.turk

                  Ah, OK.
                  I'll made a new release then compiled against 5.2.9

                  • 36. Re: jboss AS, jboss Web and php

                    nitm..r u able to run php on jboss application server. If yes can you give me the steps

                    • 37. Re: jboss AS, jboss Web and php
                      peterj

                      Please don't ask the same question in multiple locations.

                      Also, this topic has all kinds of information on setting up PHP; why aren't you following the suggestions made?

                      • 38. Re: jboss AS, jboss Web and php
                        shanelm

                        Peter, I'm hoping you still monitor this thread, as you seem to be the absolute guru when it comes to PHP integration into JBOSS. But don't let that prevent others from responding...i need all the help I can get!

                        I followed the instructions on this thread and successfully got PHP to work in JBOSS EAP 4.3 in a Windows environment. Now I'm trying to do the same on a linux environment.

                        I downloaded the Linux i686 package from http://www.jboss.org/jbossweb/downloads/php/, and immediately noticed that it doesn't include the php executable like the windows package did. Hoping this is just a difference in operating systems, I proceeded to follow the directions at http://www.jboss.org/jbossweb/modules/php/index.html

                        I extracted the tar.gz, copied jbossweb-extras.jar, modified web.xml and server.xml, and added the LD_LIBRARY_PATH entry to run.conf. When I start up JBOSS and try to access a simple phpinfo script, I get the following error:

                        java.lang.UnsatisfiedLinkError: no php5servlet in java.library.path, no libphp5servlet in java.library.path(/usr/java/jdk1.6.0_11/jre/lib/i386/server:/usr/java/jdk1.6.0_11/jre/lib/i386:/usr/java/jdk1.6.0_11/jre/../lib/i386:/bin/myproj/oe/app-server/jboss-4.3.0/PHP/lib:/usr/java/packages/lib/i386:/lib:/usr/lib)
                        org.jboss.web.php.Library.(Library.java:65)
                        org.jboss.web.php.Library.initialize(Library.java:104)
                        ...

                        This confuses me because both the libphp5.so and libphp5servlet.so are in that /bin/myproj/oe/app-server/jboss-4.3.0/PHP/lib directory. Why can't it find them?

                        I was curious to see if the libraries had the same problem as the windows distribution which Peter fixed by dumping the contents of those 2 .so files, but I didn't see any reference to *.catalina.* in them.

                        Any ideas??


                        On a side note, I don't see a php.ini included in this distribution - how am I supposed to edit php settings?

                        Thanks so much - I've been struggling with this for the entire day...

                        • 39. Re: jboss AS, jboss Web and php
                          peterj

                          The problem might not be with the libphp5servlet.so file, but rather a missing dependency. Try using the ldd command to see if that is the case.

                          There are some other posts on PHP - a search should reveal them and they might provide some more info.

                          • 40. Re: jboss AS, jboss Web and php

                            Hi Peter.

                            I done a setup for JBOSS4.2.2 .While running Dependency walker some dlls were missing I added them. But still in Dependency walker log window error is Error: "The Side-by-Side configuration information for "d:\iwatch\php5servlet-windows-sp1-i586\php\bin\PHP5SERVLET.DLL" contains errors. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem (14001)."

                            I followed below steps. Is anything missing.

                            Steps for PHP integration with JBOSS
                            1) Downloaded and unzip JBoss Appplication server 4.2.2 at location D:\iWatch\jboss-4.2.2
                            2) Download and unzip the PHP module from http://labs.jboss.com/portal/jbossweb/downloads . Call this directory as D:\iWatch\php5servlet-windows-SP1-i586\PHP
                            3) Downloaded and installed JBoss Native jboss-native-2.0.1-windows-i686-ssl: http://www.jboss.org/jbossweb/downloads/jboss-native/?action=a&windowstate=maximized
                            4) Copy JBoss Native into JBossHome directory, confirm whether you have D:\iWatch\jboss-4.2.2.GA\bin\native directory.
                            5) Make sure you do not have a stray php.ini file lying around.
                            6) moved the php.ini to the windows directory
                            7) Set the php5servlet\bin & php5servlet\bin\ext in PATH variable.
                            8) Download php5servlet.dll from
                            http://members.cox.net/ocjohnsons/php5servlet.zip
                            Replace it with php5servlet\bin
                            8) Copy php5servlet\webapps\php-examples.war into JBOSS_HOME\server\default\deploy.
                            9) added a Listener to the server.xml in server\default\deploy\jboss-web.deployer

                            10) JBOSS_HOME/server/default/deploy/jbossweb.sar/conf/web.xml
                            Edit this as

                            <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>
                            11) Download jbossweb-extras.jar for php http://anonsvn.jboss.org/repos/jbossreflex/trunk/php/jbossweb-extras.jar

                            Copy to JBOSS_HOME\server\default\lib

                            11. Environment variables setup done.



                            • 41. Re: jboss AS, jboss Web and php

                              azc

                              • 42. Re: jboss AS, jboss Web and php
                                shanelm

                                Thanks for the help, Peter.

                                Running ldd didn't show any missing dependencies, but I did notice that the user of some of the files was root. I chown'd them to something jboss can access and it worked like a charm. Score!!

                                Still curious though on how I edit php settings. There was no php.ini included in the jboss-php linux download like there was for windows. If I put one in /etc will it recognize it?

                                • 43. Re: jboss AS, jboss Web and php
                                  peterj

                                  The standard locations should be checked for the php.ini file, so it should work. I know that when I first tried this on XP it picked up my php.ini file in the windows directory.

                                  • 44. Re: jboss AS, jboss Web and php
                                    peterj

                                    ravindrashinde11, where are you seeing the "Side-by-Side configuration information" error? When you run Dependency Walker? When you one the php5servlet.dll file? Or is this showing up for a missing dependency for php5servlet.dll? Did you google "Side-by-Side configuration information"? Most of the post I saw indicated a missing Visual C++ file (typically from running something for which you don't have the necessary shared DLLs, such as msvcr80.dll).

                                    What OS are you running? 32 or 64 bit?