Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

CGI-error and IIS

Question posted by: spark (Guest) on August 11th, 2006 12:45 PM
Version 5.1.4 on Server 2003 IIS.
A virtual host.
So I am getting these 502 errors with messages saying "The specified CGI
application misbehaved by not returning a complete set of HTTP headers."
These errors have been reported since 2001 or even earlier.
My host says to wait for a stable version of PHP. Which is a silly thing to
say IMO.
My questions:
- Is this still a known bug? Either in IIS or PHP even in V5.1.4?
- Is there a workaround?
- So I have stumbled across a delay function. The problem used to be timing
related. Would that be effective?
- Any other options or thoughts, except migrating to Apache? :)

Thanks in advance!

Spark.


Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
Alvaro G. Vicario's Avatar
Alvaro G. Vicario
Guest
n/a Posts
August 11th, 2006
08:25 PM
#2

Re: CGI-error and IIS
*** spark escribió/wrote (Fri, 11 Aug 2006 14:49:08 +0200):
Quote:
Originally Posted by
So I am getting these 502 errors with messages saying "The specified CGI
application misbehaved by not returning a complete set of HTTP headers."


Just speculating... Maybe CGI is configured to run the command line
interface, which does not generate headers :-?


--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor con rayos UVA: http://www.demogracia.com
--

spark's Avatar
spark
Guest
n/a Posts
August 11th, 2006
08:55 PM
#3

Re: CGI-error and IIS

"Alvaro G. Vicario" <webmaster@NOSPAMdemogracia.comschreef in bericht
news:ou0u63ntcsjj.16j33dwhafhrb.dlg@40tude.net...
Quote:
Originally Posted by
Just speculating... Maybe CGI is configured to run the command line
interface, which does not generate headers :-?


Don't think so. In that case the errors would be consistent.
These errors seem to occur at random.
Thanks for the input though.

Spark.



spark's Avatar
spark
Guest
n/a Posts
August 14th, 2006
06:15 AM
#4

Re: CGI-error and IIS
"spark" wrote:
Quote:
Originally Posted by
Version 5.1.4 on Server 2003 IIS.
A virtual host.
So I am getting these 502 errors with messages saying "The specified CGI
application misbehaved by not returning a complete set of HTTP headers."
These errors have been reported since 2001 or even earlier.
My host says to wait for a stable version of PHP. Which is a silly thing
to say IMO.
My questions:
- Is this still a known bug? Either in IIS or PHP even in V5.1.4?
- Is there a workaround?
- So I have stumbled across a delay function. The problem used to be
timing related. Would that be effective?
- Any other options or thoughts, except migrating to Apache? :)


Bump.
So looking at all these replies :) there are a few possible conclusion:
-Nobody knows;
-Nobody cares;
-Nobody has site site on an Windows-based platform;
-Nobody has encountered this problem.
Maybe a few more.
So assuming the first 3 can't be true, I take it then, that the old problem
is solved in PHP 5.1.4?
If that is the case, then why are these errors occuring?

Imagine having a website with about 10% of the hits returning a 502. I've
had that a few days back. This is just disastrous....
Things are more stable now, but I am worried.
So let's be more specific.
On almost every page I have:

<?php ob_start("ob_gzhandler"); ?>

I have a stylesheet page called styles.php with the header:
<?php header("Content-type: text/css; charset=UTF-8"); ?>
Called from every page with:
<link rel="stylesheet" type="text/css"
href="http://www.mydomain.com/stylesheet.php?pageID=<?php echo $pageID; ?>">
$pageID is a variable with which I determine which colors to use. These data
are stored in MySQL.
Any flaws in this?

Thanks voor your thoughts.

Spark.



Jerry Stuckle's Avatar
Jerry Stuckle
Guest
n/a Posts
August 14th, 2006
11:35 AM
#5

Re: CGI-error and IIS
spark wrote:
Quote:
Originally Posted by
Version 5.1.4 on Server 2003 IIS.
A virtual host.
So I am getting these 502 errors with messages saying "The specified CGI
application misbehaved by not returning a complete set of HTTP headers."
These errors have been reported since 2001 or even earlier.
My host says to wait for a stable version of PHP. Which is a silly thing to
say IMO.
My questions:
- Is this still a known bug? Either in IIS or PHP even in V5.1.4?
- Is there a workaround?
- So I have stumbled across a delay function. The problem used to be timing
related. Would that be effective?
- Any other options or thoughts, except migrating to Apache? :)
>
Thanks in advance!
>
Spark.
>
>


I use the isapi version with Windows, and it works fine. I've been
using it since early PHP4, and have upgraded regularly (currently using
5.1.2). Used them on both W2K and W2K3.

If it's configured correctly, the only thing I've seen cause problems is
bad PHP code causing an abnormal termination of the PHP thread/process.
No, it shouldn't happen since PHP is interpreted, but it sometimes
does. And every time I've seen it happen it's been bad (invalid) code
that screws up the parser.

But again - I don't use the CGI version. It's performance isn't as good
as the isapi version, IMHO.

My suggestion - if it's not your code and your host can't get their end
working, find another host.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
Join Bytes!
==================

spark's Avatar
spark
Guest
n/a Posts
August 14th, 2006
04:35 PM
#6

Re: CGI-error and IIS

"Jerry Stuckle" wrote
Quote:
Originally Posted by
I use the isapi version with Windows, and it works fine. I've been


Yup, that's what the hoster suggested. The only thing was, that it too had
some error: it didn't recognize "mysql_pconnect".
He fixed that.
Quote:
Originally Posted by
If it's configured correctly, the only thing I've seen cause problems is
bad PHP code causing an abnormal termination of the PHP thread/process.


Because of the new isapi settings he also turned on some error messaging,
which revealed a mistake (I am not ready to admit that forgetting some
quotes was a blunder :) ).
But it sure wasn't the cause of the malfunction.
Quote:
Originally Posted by
My suggestion - if it's not your code and your host can't get their end
working, find another host.


Thanks for the reassuring words.
We'll wait and see what the isapi setting will do.
The hosting company has an excellent helpdesk service, they helped me out
often enough and these guys are alright.

Cheers,

Spark.



Jerry Stuckle's Avatar
Jerry Stuckle
Guest
n/a Posts
August 15th, 2006
02:35 AM
#7

Re: CGI-error and IIS
spark wrote:
Quote:
Originally Posted by
"Jerry Stuckle" wrote
>
>
Quote:
Originally Posted by
>>I use the isapi version with Windows, and it works fine. I've been

>
>
Yup, that's what the hoster suggested. The only thing was, that it too had
some error: it didn't recognize "mysql_pconnect".
He fixed that.
>
>
Quote:
Originally Posted by
>>If it's configured correctly, the only thing I've seen cause problems is
>>bad PHP code causing an abnormal termination of the PHP thread/process.

>
>
Because of the new isapi settings he also turned on some error messaging,
which revealed a mistake (I am not ready to admit that forgetting some
quotes was a blunder :) ).
But it sure wasn't the cause of the malfunction.
>
>
Quote:
Originally Posted by
>>My suggestion - if it's not your code and your host can't get their end
>>working, find another host.

>
>
Thanks for the reassuring words.
We'll wait and see what the isapi setting will do.
The hosting company has an excellent helpdesk service, they helped me out
often enough and these guys are alright.
>
Cheers,
>
Spark.
>
>


OK, and BTW - I wouldn't recommend using mysql_pconnect() unless you are
doing dozens of connections per second. Otherwise using it keeps a lot
of unused resources allocated all the time.

I have yet to see a website using MySQL where mysql_pconnect() is
worthwhile. I'm sure they exist - but I haven't run into anything
nearly that heavy usage.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
Join Bytes!
==================

spark's Avatar
spark
Guest
n/a Posts
August 15th, 2006
06:05 AM
#8

Re: CGI-error and IIS

"Jerry Stuckle" wrotespark wrote:
Quote:
Originally Posted by
OK, and BTW - I wouldn't recommend using mysql_pconnect() unless you are
doing dozens of connections per second. Otherwise using it keeps a lot of
unused resources allocated all the time.
>
I have yet to see a website using MySQL where mysql_pconnect() is
worthwhile. I'm sure they exist - but I haven't run into anything nearly
that heavy usage.


A standaard in dreamweaver. I never thought of looking into that. I will
though.
(Chapter 41 on php.net :) )

The site is now running flawlessly, so far...

Thanks again,

Spark.



 
Not the answer you were looking for? Post your question . . .
173,563 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

  • Didn't find the answer you were looking for?
    Post Your Question
  • Top Community Contributors