Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The specified CGI application misbehaved

Status
Not open for further replies.

GiantDaddY

Programmer
Sep 21, 2001
9
BE
I'm using php 5.0.4 on a Windows 2000 server.

When I try the following code :

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo "<p>Hello World</p>"; ?>
</body>
</html>

I get the following :

"
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:

Hello World
"
Any ideas ? I checked security on the php directory, on the directory where the php file is located ... but nothing helps.
 
I'll wager you're running PHP as a CGI. If so, you're going to have to produce the minimum HTTP headers in your scripts.

At a minimum, you're going to have to send a "Content-Type: text/html" line.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
No, I'm not running php as a CGI, when I do everything works fine, but adding the line to my script helped to get the normal version of php running.

A strange thing though, when I run the phpinfo() function I only get text, when I run it in cgi mode I get a nice version with colors and all.
 
Correction of my previous post, when I removed the phpinfo() function from my script, I get the same error again !
 
I just got it working !

As most It people I wanted to run before I could walk ;-)

I entered the php5isapi.dll instead of php.exe in the IIS configuration and now everything works fine !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top