4 Replies Latest reply on Jun 7, 2010 6:31 PM by hectorgonzalez

    Load Balance + Cluster + JBoss-5.1.0.GA + PHP5 + Win2K3

      Hello there,

       

      The problem that my boss deliverer to me is the following:

       

      We have only 5 boxes available for this project, all with Windows 2003 Server Enterprise Edition and we need to offer our users a robust solution to host several PHP applications, which uses MySql.

       

      I have been following several threads about it on this community. But I came to a sort of death end.

      So far I have done the following:

       

      1. Setup Apache as Load Balance (I do not know if JBoss Web can do this).  Port:8090
      2. Setup JDK-6u20-windows-i586.exe
      3. Setup mysql-5.1.46-win32.msi
        1. Setup mysql-connector-java-5.0.8.zip
      4. Setup a JBoss-5.1.0.GA.zip  Port:8080
        1. Configure one Cluster whit 2 nodes, each one is in different box.
        2. Setup JBoss-native-2.0.9-windows-x86-ssl.zip
        3. Setup JBossweb-extras.jar.zip
      5. Setup PHP-5.2.12-Win32.zip
        1. Setup php5servlet-windows-i586-SP1.zip
        2. Setup php5servlet.zip

       

      JAVA_HOME=C:\Java\jdk1.6.0_20

      JBOSS_HOME=c:\jboss-5.1.0.GA

      JBOSS_CLASSPATH=%JBOSS_HOME%\bin\run.jar;C:\php5servlet\PHP\bin

       

      I am able to run Apache:8090 and display JMX-Console and Web-Console

      I am able to lauch the JBoss-5.1.0.GA Cluster in node1 and node2

      I am not able to Probe node1 nor node2

      When I setup PHP and JBoss for org.jboss.web.php.Handler and org.jboss.web.php.Highlight (as replace for catalina´s)

       

      I have the following ERROR:

      ERROR [[/jbossws]] StandardWrapper.Throwable java.lang.UnsatisfiedLinkError:
      no php5servlet in java.library.path,
      no libphp5servlet in java.library.path

       

      I do not know if is just a classpath problem or what. I would like to have advice from yours in order to get this thing done!

      I already making an article that want to post it here.

       

      Thanks is advance,

      Hector

        • 1. Re: Load Balance + Cluster + JBoss-5.1.0.GA + PHP5 + Win2K3
          peterj

          >>I have the following ERROR:

          ERROR [[/jbossws]]  StandardWrapper.Throwable java.lang.UnsatisfiedLinkError:
          no  php5servlet in java.library.path,
          no libphp5servlet in  java.library.path

           

          The problem is that the java.library.path is not set correctly. It needs to include not only the php5servlet.dll file, but also all DLLs in which it depends. If you have followed these threads:

          http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4146675#4146675

          http://community.jboss.org/thread/80067?tstart=0

          http://community.jboss.org/message/426266#426266

          and are still having a problem, then try using the Dependency Walker (http://www.dependencywalker.com/) app to verify the required DLLs, and try using the Process Monitor (http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx) to watch what DLLs the JVM is loading.

           

          Personally, I no longer use php5servlet, instead I use Quercus (http://quercus.caucho.com/)

          • 2. Re: Load Balance + Cluster + JBoss-5.1.0.GA + PHP5 + Win2K3

            Peter,

             

            Many thanks for your reply.

             

            I installed Ms. Framework 3.5 SP1 and downloaded Dependency Walker. No problems with dll.

            I test it and the console came up with no errors.

            I launched index.php with phpinfo(), but I cannot see MySQL information, therefore, when I launch testdb.php.....

            I get in the JBoss SA console:

            PHP Fatal error:  Call to undefined function mysql_connect() in C:\jboss-5.1.0.G
            A\server\all\deploy\ejemplo.war\testdb.php on line 5

             

             

            testdb.php

            <?php
                    $username = "root";
                    $password = "manager";
                    $hostname = "localhost";
                    $dbh = mysql_connect($hostname, $username, $password)
                    or die("Unable to connect to MySQL");
                    print "Connected to MySQL";
                    $selected = mysql_select_db("test",$dbh) or die("Could not select first_test");
                    if (mysql_query("insert into people values('1','Indranil','Burger')")) {
                        print "successfully inserted record";
                    }
                    else {
                       print "Failed to insert record";
                    }
                    mysql_close($dbh);
            ?>

             

            Peter,

             

            I will download and install Quercus. I will post you my results later.

             

            Gracias, again

            • 3. Re: Load Balance + Cluster + JBoss-5.1.0.GA + PHP5 + Win2K3
              peterj

              I suspect that the mysql.so module is in the wrong location. If I recall correctly, the ph5servlet comes with its own version of PHP and thus its own versions on the various modules, and it does not come with all of the modules (which means it would be very hard to supply the mysql module). I recall there was a way to redirect php5servlet to use an installed PHP instead of its built-in one, but I also recall that I never had luck getting that to work.

               

              Now I have to state that I did the work with php5servlet over 2 years ago so my recollections might not be that accurate. My qork with Quercus has been very recent though, I think you will probably be happy with it.

              • 4. Re: Load Balance + Cluster + JBoss-5.1.0.GA + PHP5 + Win2K3

                Peter,

                 

                I changed on my C:\jboss-5.1.0.GA\server\all\deploy\jbossweb.sar\server.xml the folllowing:

                 

                Find <Listener className="org.jboss.web.php.LifecycleListener"/> and comment this out.

                 

                I commented every php serverlet reference and changed into C:\jboss-5.1.0.GA\server\all\deploy\jbossweb.sar\server.xml

                 

                It is working, what I found is that the phpinfo();  it is pretty different in quercus then PHP itselft.

                 

                I am able to insert and select several record.

                 

                I also found that quercus can run under WebLogic, sound interestee to talk.

                 

                Thanks againg, Peter

                 

                Bye