By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,051 Members | 1,246 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,051 IT Pros & Developers. It's quick & easy.

Minimal Install - CGI

P: n/a
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
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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" <de**@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

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.