Minimal Install - CGI

This is a discussion on Minimal Install - CGI within the PHP Language forums, part of the PHP Programming Forums category; Hello, I am trying to do a "minimal install" using PHP as CGI. For my app there is ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-04-2003
ChronoFish
 
Posts: n/a
Default 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


Reply With Quote
  #2 (permalink)  
Old 11-05-2003
ChronoFish
 
Posts: n/a
Default 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@chronofish.com> wrote in message
news:teSpb.1090$oB3.260@lakeread03...
> 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
>
>



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 07:00 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0