Hi -

This is my first post here, and I just hope I can explain it clearly ...

I am trying to configure the PHP-Java Bridge for an Eclipse project. In order to do this, I need to include the php-cgi binary in the project. My problem is this: I can't find the php-cgi binary....

I'm using Mac OS X 10.5.8 Client, and PHP 5.3.1. I have tried using Marc Liyanage's build for OS X: he states in his FAQ that he includes php-cgi within his distributions' /usr/local/php5/bin directory, but it isn't there.

I have also tried building PHP myself, but being a complete newcomer to this I'm getting lost in the config switches.

I am starting to suspect that in PHP 5.3 there is NO separate php-cgi binary, but rather the php binary handles cgi mode. Is this the case ? (I sort of hope it isn't because Eclipse / PHP-Java Bridge doesn't like it, but at least I'd be ruling out one unknown). But I can't find any mention of such a change in the PHP changelogs or elsewhere.

If I'm wrong, can somebody please explain to me how to build php-cgi under Mac OS X ?

Thanks very much ... I'm hitting brick walls here!

David

    In the Windows distribution of PHP 5.3.1
    there is one php-cgi.exe
    I can not tell how about Linux or MAC OS X.

    I would send an EMAIL to Marc Liyanage. He should know.
    Or even better, ask in his
    Entropy.ch Discussion Forums http://www.entropy.ch/phpbb2/

    Maybe if your search his forum,
    somebody else might have already asked about php-cgi

      Thanks, I checked Marc's forum yesterday but it doesn't seem very active... somebody asked a similar question a while back and got 0 replies. But I'll try.

        MAMP has PHP 5.2.10

        For a good package with Apache + MySQL + PHP
        I would definitely use XAMPP
        http://www.apachefriends.org/en/xampp-macosx.html#849

        It is very easy and robust to install. And absolutely free, non-commercial.
        XAMPP current MAC OS X package has got Apache 2.2.12, MySQL 5.1.37, PHP 5.3.0,
        I run Apache 2.2 and PHP 5.3.0 myself.

          I ran into the same problem with PHP 5.3.1. I downgraded to PHP 5.3.0 and was able to get php-cgi to compile without any problems, so I'm beginning to think it's a bug. You should be able to find the binary under the sapi/cgi subdirectory of your installation directory.

            7 months later

            Hi,

            I'm experiencing a problem similar to what reported by davidrm.

            I can't enable PHP scripting from Tomcat using JavaBridge. I've tried many configuration, but the problem seems to be related to the lack of php-cgi (or equivalent) module.

            Testing JavaBridge.war from command line, after creating a link to php named php-cgi, works fine. But after deploying the application on Tomcat I'm not able to run it correctly.

            Did anybody find a solution for these problems?

            Thank you very much in advance.

            Alessandro

              3 months later

              If you already have the php command line interface installed and working (should be by default) just make a symbolic link to php-cgi

              sudo ln -s /usr/bin/php /usr/bin/php-cgi

              I that was the solution for me to successfully run the
              java -classpath JavaBridge.war TestInstallation
              command

              Best of luck

                18 days later
                asicoli;10962529 wrote:

                Hi,

                I'm experiencing a problem similar to what reported by davidrm.

                I can't enable PHP scripting from Tomcat using JavaBridge. I've tried many configuration, but the problem seems to be related to the lack of php-cgi (or equivalent) module.

                Testing JavaBridge.war from command line, after creating a link to php named php-cgi, works fine. But after deploying the application on Tomcat I'm not able to run it correctly.

                Did anybody find a solution for these problems?

                Thank you very much in advance.

                Alessandro

                I was running into this exact problem. By symlinking my 'php' executable, the command line test of javabridge worked fine. However, when accessing it through a browser at http://localhost.com:8080/JavaBridge , it would give errors about server not found (fast cgi). My problem was as follows:

                With the newest php build (5.3.4) on a Mac OSX, I configured php with the '--with-apxs2' option since I'm running apache on the same server I ran tomcat on (localhost). 'php -v' would not show (cgi-fcgi). There was no 'php-cgi' binary created.

                To solve it, I re-built php in a different location without the '-with-apxs2' option and it built the php-cgi binary. Doing a 'php-cgi -v' showed the (cgi-fcgi) as it should. Restarted Tomcat and VOILA! My JavaBridge test app worked as intended.

                Hope this helps

                  Write a Reply...