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

        peter,

        i uninstalled and deleted everything (java, jboss, php) and re-installed them...

        installations:
        - java: C:\apps\java\jdk1.5.0_14
        - jboss: C:\apps\server\jboss\application-server\jboss-4.2.2.GA
        - php: C:\apps\server\php\php5servlet-windows-SP1-i586\PHP

        steps i did to configure jboss with php:
        - copied the php5servlet.dll to the bin\native dir of the jboss
        - added a Listener to the server.xml in server\default\deploy\jboss-web.deployer
        - added the servlets/servlet-mapping in the web.xml in server\default\deploy\jboss-web.deployer\conf

        i still get the same error (Can't find SAPI class, no libphp5servlet in java.library.path).

        JBossAS is working with 1.5VM:
        [ServerInfo] Java VM: Java HotSpot(TM) Server VM 1.5.0_14-b03,Sun Microsystems Inc.

        what the server says on startup:

        JBoss Bootstrap Environment
        
        JBOSS_HOME:
         C:\apps\server\jboss\application-server\jboss-4.2.2.GA
        
        JAVA:
         C:\apps\java\jdk1.5.0_14\bin\java
        
        JAVA_OPTS:
         -Djava.library.path="
         C:\apps\server\jboss\application-server\jboss-4.2.2.GA\bin\native;
         C:\WINDOWS\system32;
         C:\WINDOWS;
         C:\WINDOWS\System32\Wbem;
         C:\apps\java\jdk1.5.0_14\bin;
         C:\apps\server\jboss\application-server\jboss-4.2.2.GA\bin;
         %JBOSS_HOME\bin\native;
         C:\apps\server\php\php5servlet-windows-SP1-i586\PHP\bin;
         C:\apps\server\php\php5servlet-windows-SP1-i586\PHP\bin\ext;"
         -Dprogram.name=run.bat -server -Xms128m -Xmx512m
         -Dsun.rmi.dgc.client.gcInterval=3600000
         -Dsun.rmi.dgc.server.gcInterval=3600000
        
        CLASSPATH:
         C:\apps\java\jdk1.5.0_14\lib\tools.jar;
         C:\apps\server\jboss\application-server\jboss-4.2.2.GA\bin\run.jar


        i also checked the php5servlet.dll with the dependency walker and it shows the same as before...

        did i forget something?
        i used these two urls for help:
        - http://labs.jboss.com/file-access/default/members/jbossweb/freezone/modules/php/index.html
        - http://samaxes.com/php-tutorial/jbossweb.php

        and on the first one it says: "Replace the servlets-php.jar by jbossweb-extras.jar"..
        i can't find any servlets-php.jar so i don't know where i should place that new file (if at all), plus there's a link there to the "latest" version of the jbossweb-extras, how can i know that it's really the latest?
        i did try to put that jar in server\default\deploy\jbossws.sar but it did not work.. do i need that file at all?

        that's about it i guess.. i did try to keep a log of everything i'm doing so i hope that this post has enough information.

        thanks a lot, nitzan.

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

          I am setting up PHP on JBossAS 4.2.2 on my desktop at home. So far, I am at the same point you are - I did the same steps, and am getting the same error. I am now trying to figure out what I did at work (where I have this running) that was different from what I have done so far.

          I could go to work and find out, but considering that I am on vacation this week and next, I really do not want to. I will search the forums because I know the answer is out there - I just have to find it. If all else fails, I run to work with my USB key and bring the working configuration home for analysis. Which reminds me, I do have to water my plants, maybe I'll go tomorrow.

          Regarding jbossweb-extras.jar, put it in server/xxx/lib. I would get that file from the php-examples.war file from the PHP modules download.

          By the way, if you are using the php-examples.war file to see if php works, you do not need to change the web.xml and service.xml files in jboss-web.deployer, nor do you have to place jbossweb-extras.jar in the server/xxx/lib directory. But doing so does not hurt anything.

          • 17. Re: jboss AS, jboss Web and php
            nitm

            well, i'm glad that it's not something wrong @ my end..
            thanks for the help, i searched the forums a lot and did not find something that will help... maybe you can do a better job (maybe you know better what it is we're looking for).

            i'm not using the php-examples.war so i'll place the jbossweb-extras.jar in the server/default/lib.

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

              I got my php setup from work and have it running at home. The difference is that I used an older version of the php-related code. With the old code, you had to use the old package name, org.apache.catalina.servlets.php, instead of the new package name: org.jboss.web.php.

              I examined the php5servlet.dll files. In both cases (the working setup from work and the non-working setup at home), the file has the same date - 9/11/2006. Examining that file with a hex editor, I will give you two guesses as to which package name it is using for the SAPI file. That's right, it is using the old name (org.apache.catalina.servlets.php).

              The page http://labs.jboss.com/file-access/default/members/jbossweb/freezone/modules/php/index.html has a link to the source code for php5servlet.dll (it is frustrating to find that most of the links on that page are broken - I get a "Sorry, you don't have access to this resource" error). I downloaded the source and it uses the new package name. Now I just have to get a compiler (never had one at home), or go back to work to compile the source.

              I looked at the links on the download page http://labs.jboss.com/jbossweb/downloads/php/?action=a&windowstate=maximized. The windows download has version number 1.0.0.GA-SP1, while the others have 1.0.2. In addition, the url used for the windows download is very different from the other downloads. This leads me to believe that the windows download link was never updated to reference the latest build. It would be nice if someone on the JBoss team updated that link so that we can download the correct PHP module, with the latest php5servlet.dll.

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

                Eureka!

                I rebuilt the php5servlet.dll (had to install Visual C++ Express and the platform SDK, the source for PHP, and make various modifications in the makefile 'cuz it was looking in very unusual locations for the php include files), placed the php5servlet.dll in my bin/native directory, fired up JBossAS, and now the PHP examples are running.

                Time for a beer break!!!

                • 20. Re: jboss AS, jboss Web and php
                  nitm

                  great news!
                  happy to hear that you located the problem and that you solved it as well..

                  any chance that you can some how place the new php5servlet.dll somewhere on the web so i'll be able to download it? i would prefer not to start to compile c++ code since (in experience) it's always trouble.. and if you already have it running...

                  thanks!!!!
                  nitzan.

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

                    I tried adding the DLL to the JBoss Web wiki, but after logging in, when I click on the "attach" link, I get the following output:

                    ERROR

                    There is lack of page name or page name should be uppercase


                    So I did the next best thing - uploaded it to my cable account. You can find the dll at: http://members.cox.net/ocjohnsons/php5servlet.zip

                    • 22. Re: jboss AS, jboss Web and php
                      nitm

                      OMG!!!
                      it works!!! finally!!!! after a long month (give or take).

                      thanks a lot peter, you the man!

                      the jboss folks should know about this no?

                      • 23. Re: jboss AS, jboss Web and php
                        rotsen

                        Peter/nitzan,

                        I was hoping to get a hand from you. I am trying to get jboss-portal-2.6.3.GA to work with php.

                        installation
                        ------------------------------------------------------------------
                        JBOSS_HOME: C:\Documents and Settings\nflorez\My Documents\DOWNLOADS\jboss-portal-2.6.3.GA

                        JAVA: C:\Program Files\Java\jdk1.5.0_14\bin\java

                        JAVA_OPTS: -Djava.library.path="C:\Documents and Settings\nflorez\My Documents\DOWNLOADS\jboss-portal-2.6.3.GA\bin\native;
                        C:\Perl\bin;
                        C:\Python\.;
                        X:\Orawin9i\bin;
                        C:\Documents and Settings\nflorez\My Documents\DOWNLOADS\jboss-portal-2.6.3.GA\bin;
                        C:\Documents and Settings\nflorez\My Documents\DOWNLOADS\jboss-portal-2.6.3.GA\bin\native;
                        C:\Documents and Settings\nflorez\My Documents\DOWNLOADS\php5servlet-windows-SP1-i586\PHP\bin;
                        C:\Documents and Settings\nflorez\My Documents\DOWNLOADS\php5servlet-windows-SP1-i586\PHP\bin\ext;
                        C:\Program Files\Control Center;
                        C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;
                        C:\Documents and Settings\nflorez\My Documents\libxml2\bin" -Dprogram.name=run.bat -server -Xms128m -Xmx
                        512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000

                        CLASSPATH: C:\Program Files\Java\jdk1.5.0_14\lib\tools.jar;
                        C:\Documents and Settings\nflorez\My Documents\DOWNLOADS\jboss-portal-2.6.3.GA\bin\run.jar
                        ------------------------------------------------------------------

                        My PHP is a regular 4.4.2 php installation. PHP= C:\php

                        1) Will it work with a regular php ionstallation?
                        2) Do I need to copy the C:\Documents and Settings\nflorez\My Documents\DOWNLOADS\php5servlet-windows-SP1-i586\PHP\ext\*.dll to my c:\php\extensions directory?

                        In the http://samaxes.com/php-tutorial/jbossweb.php in the section "it's now time to run" it says to create an index.php file in the jbossweb.sar/ROOT.war folder but I do not have that folder, so I created it in the jboss-web.deployer folder.

                        How do I see that is there???

                        Thanks,

                        Nestor :-)

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

                          1) You will need a 5.1.x version of PHP.
                          2) No, having it in your classpath is sufficient

                          In php5servlet-windows-SP1-i586, there should be a php-examples.war directory, copy it to your deploy directory and then access it as http://localhost:8080/php-example/index.php.

                          • 25. Re: jboss AS, jboss Web and php
                            rotsen

                            Peter,

                            I have installed php 5.2.? (the lastest stable as of yesterday)
                            and I am using your php5servlet.dll

                            I got PHP working...yeah!!!!...

                            Another question: Can I put a package like phpbb3 or phpmyadmin in the php-examples folder and it should work, correct?
                            I will try this but I was wondering if you have try this already.

                            Thanks a lot Peter!!!!!

                            Nestor :-)

                            • 26. Re: jboss AS, jboss Web and php
                              nitm

                              hi

                              i am using phpMyAdmin with jboss AS.
                              i didnt put it in the samples directory (i am not using the sample dir at all), instead i just packed it up in a war and deployed it as a regular jboss application.
                              it works great.

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

                                As nitm pointed out, any war file should work. Just follow the example provided by php-examples.war.

                                • 28. Re: jboss AS, jboss Web and php
                                  rotsen

                                  Guys,

                                  I got php working by going to this url:http://10.100.5.126:8080/php-examples/internet.html

                                  Can I show my php page as one of my tag/page on my portal http://10.100.5.126:8080/portal
                                  where the url is http://10.100.5.126:8080/portal/default/internet ?
                                  or is it possible to include as a portlet/window in one of my pages ?

                                  I have been looking for this and I can not find anything.

                                  Thanks,

                                  Nestor :-)

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

                                    The closest you can get is to use an iframe portlet to host the contents of the php page. There is an iframe portlet in PorltetSwap.