Minimal Install - CGI

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ChronoFish

    #1

    Minimal Install - CGI

    Hello,

    I am trying to do a "minimal install" using PHP as CGI. For my app
    there is no need for the server to be modified - I'm not trying to get
    the server to recognize a PHP file and automatically call the PHP
    executable.

    The environment that I am currently working on is Win32 (XP) with
    Apache up an running and seemingly working correctly. (It serves up
    pages and will execute and display my "hello.exe" - a simple "hello
    world").

    What I think I should be able to do is simply copy the php4ts.dll,
    php.exe, and php.ini into the cgi-bin directory. The php.ini file is
    the "php.ini-recommended" that came with the PHP.

    I created a phpinfo.php in the CGI directory and it looks like this:

    #!c:\www\cgi-bin\php.exe
    <?php
    print ("Content-type: text/html\n\n");
    print ("PHP Works!");
    ?>

    The result I get is : "The page cannot be displayed" with a page title
    of "Cannot find server".

    It appears that the PHP program is being found, because if I change
    the server directive to look for a non-existent php.exe
    (#!c:\www\cgi-bin\php-blah.exe) I get an "Internal Server Error"
    instead.

    From the command line I get:

    C:\www\cgi-bin>php.exe phpinfo.php
    Content-type: text/html
    X-Powered-By: PHP/4.3.4

    Content-type: text/html

    PHP Works!



    (Interesting that it's printing out the Content-type automatically)



    Any ideas?

    Thanks!
    Christopher


  • ChronoFish

    #2
    Re: Minimal Install - CGI

    I discovered my problem. The PHP.exe that needs to be executed is the CLI
    version. I will be ecstatic if the PHP developers ever decide to give PHP a
    compile option.

    -CF




    "ChronoFish " <deja@chronofis h.com> wrote in message
    news:teSpb.1090 $oB3.260@lakere ad03...[color=blue]
    > Hello,
    >
    > I am trying to do a "minimal install" using PHP as CGI. For my app
    > there is no need for the server to be modified - I'm not trying to get
    > the server to recognize a PHP file and automatically call the PHP
    > executable.
    >
    > The environment that I am currently working on is Win32 (XP) with
    > Apache up an running and seemingly working correctly. (It serves up
    > pages and will execute and display my "hello.exe" - a simple "hello
    > world").
    >
    > What I think I should be able to do is simply copy the php4ts.dll,
    > php.exe, and php.ini into the cgi-bin directory. The php.ini file is
    > the "php.ini-recommended" that came with the PHP.
    >
    > I created a phpinfo.php in the CGI directory and it looks like this:
    >
    > #!c:\www\cgi-bin\php.exe
    > <?php
    > print ("Content-type: text/html\n\n");
    > print ("PHP Works!");
    > ?>
    >
    > The result I get is : "The page cannot be displayed" with a page title
    > of "Cannot find server".
    >
    > It appears that the PHP program is being found, because if I change
    > the server directive to look for a non-existent php.exe
    > (#!c:\www\cgi-bin\php-blah.exe) I get an "Internal Server Error"
    > instead.
    >
    > From the command line I get:
    >
    > C:\www\cgi-bin>php.exe phpinfo.php
    > Content-type: text/html
    > X-Powered-By: PHP/4.3.4
    >
    > Content-type: text/html
    >
    > PHP Works!
    >
    >
    >
    > (Interesting that it's printing out the Content-type automatically)
    >
    >
    >
    > Any ideas?
    >
    > Thanks!
    > Christopher
    >
    >[/color]


    Comment

    Working...