That script returned this:

Trying /home/public_html/scripts -c ./php.ini getbrowser.php "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)"
passthru failed 126

    You are taking out the call to php and replacing it with /home/public_html/scripts

    Just cut and paste what I posted and it should work if the two files are in the same dir.

      I think I'm getting closer. This time the script returned this:

      Trying /usr/local/bin/php -c php.ini getbrowser.php "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)"
      Could not open input file: getbrowser.php.
      passthru failed 1

        Is getbrowser.php is the same dir?
        You could try ./getbrowser.php otherwise.

          main.php
          getbrowser.php
          php.ini
          browscap.ini

          all those files are in the same directory, which is /home/scripts

            Getting closer.

            Try replacing this line
            echo 'Trying '."/usr/local/bin/php -c ./php.ini getbrowser.php \"$HTTP_USER_AGENT\"\n";

            with

            echo 'Trying '."/usr/local/bin/php -c ./php.ini /home/scripts/getbrowser.php \"$HTTP_USER_AGENT\"\n";

              That returns this:

              Trying /usr/local/bin/php -c ./php.ini /home/scripts/getbrowser.php "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)"

              Warning: get_browser(): browscap ini directive not set. in /home/scripts/getbrowser.php on line 13
              passthru worked

                You obviously have been changing this line as well.

                passthru( "/usr/local/bin/php -c /home/scripts/php.ini /home/scritps/getbrowser.php \"$HTTP_USER_AGENT\" ",$ret );

                It must need the full path for both php.ini and getbrowser.php

                  I didn't know both needed the path, that's what confused me. It now shows:

                  Trying /usr/local/bin/php -c /home/scripts/php.ini /home/scripts/getbrowser.php "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)"
                  passthru worked

                  Now what do I do?

                    Put some debug in getbrowser.php

                    Probably
                    phpinfo();
                    print_r( $GLOBALS );

                    This will give you a good idea of what is happening.

                      Ok -- I have to say, thanks a LOT for all of your help! 😃

                        Write a Reply...