Page 1 of 1
The specified CGI application misbehaved;
Posted: Tue Sep 02, 2003 1:33 pm
by NoReason
The specified CGI application misbehaved by not returning a complete set of HTTP headers.
Running IIS:5
PHP4.3.3 (php.exe)
1) yes the page exists, using header('Location:
http://www.mywebsite.com/');
2) yes I have tried header('Location:
http://www.mywebsite.com/index.php');
3)yes check to see if file exists is checked, and not it does not fix the issue.
4) this problem only exists when using the EXE, not when using the isapi dll.
For what I read on teh release notes of 4.3.3 this issue should have been fixed, but I suppose since I am still using IIS the devs did not account for this.
Its very simple, page sends info to proccessing page, it then header() redirects back to the main site.. If I refresh the page all is well, all information was passed back, no data lose, session information intact, all works with in specified parameters... All that is except for the redirect.. and YES I can duplicate it.
I wold love to discover what the hell is going on here.. it works with no errors and no modifications to the code in redhat.. so it MUST be a IIS thing..
Posted: Tue Sep 02, 2003 4:13 pm
by volka
php.ini wrote:; cgi.rfc2616_headers configuration option tells PHP what type of headers to
; use when sending HTTP response code. If it's set 0 PHP sends Status: header that
; is supported by Apache. When this option is set to 1 PHP will send
; RFC2616 compliant header.
; Set to 1 if running under IIS. Default is zero.
;cgi.rfc2616_headers = 0
did you change that?
Posted: Tue Sep 02, 2003 4:14 pm
by Stoker
What version of PHP, the CLI or the CGI? It must be the CGI version in order to return the headers the webserver needs..
A quickfix is to add this to the top of your script:
echo "Content-Type: text/html\r\n\r\n";
but it wouldnt work very well if your script uses the header() function for other stuff, and it wont work when the script is used with another mod_php or cgi-php setup..
Posted: Tue Sep 02, 2003 4:14 pm
by Stoker
heh, Volka is a few seconds ahead of me in everything today

Posted: Tue Sep 02, 2003 4:15 pm
by volka
must be my lucky day :-]
Posted: Tue Sep 02, 2003 4:28 pm
by NoReason
Yup yup...I managed to see that during my initial INI scouring.
It didnt change the behaviour.
Posted: Tue Sep 02, 2003 5:58 pm
by volka
but you should if you use IIS, as mentioned by the comment. The default is
cgi.rfc2616_headers=0 but you need
Posted: Tue Sep 02, 2003 6:01 pm
by NoReason
Well and good then, I leave it as it is.. But the fact still remains that even after all those modifications, the error still exists while using the CGI version on php.. (php.exe) but not in ISAPI.
I can use ISAPI, however the lack of error reporting sux.
Posted: Wed Sep 03, 2003 5:09 am
by twigletmac
The specified CGI application misbehaved by not returning a complete set of HTTP headers.
That's IIS's default 'page not found', ie. 404 error for missing PHP scripts. To check whether that is the problem, start up Internet Services Manager, right click on your website in the list, select properties then the Home Directory tab, click configuration then select the PHP extension from the list and click edit. Then ensure that the 'Check file exists' check box is ticked and OK everything. You should now get a proper 404 if the PHP page is missing.
Mac
Posted: Wed Sep 03, 2003 12:05 pm
by NoReason
3)yes check to see if file exists is checked, and not it does not fix the issue.
Please note my origanal post
And with that box checked there is no 404 page... as a matter of fact there should BE no 404 or any nother error page for that matter.. The page DOES exist, its the main index.php that is begin refrenced.
And note, the script works 100% in redhat.
And works with no errors when using the ISAPI dll ..
Posted: Thu Sep 04, 2003 5:42 am
by twigletmac
Sorry missed that

, that'll teach me to read posts better.
Have you tried messing with the header() statement, you know, removing the space between Location and the URL? Shouldn't make a difference but you never know. Does a relative URL in the redirect do anything?
Mac
Posted: Thu Sep 04, 2003 12:13 pm
by NoReason
Modifiing the header statement does nothing.
Im sorry I dont know what you mean by "a relitive URL".
Posted: Fri Sep 05, 2003 3:42 am
by twigletmac
By relative I mean, instead of the absolute URL, e.g.
http://www.mywebsite.com/index.php, you use the relative path to the page. So if for instance you were in a folder one up from the root directory, you would do:
This works fine using PHP 4.2 on IIS 4 and PHP 4.3.1 on IIS 5 (both on Win 2k).
Are you sending any other headers? Are you setting any cookies before doing the redirect?
Mac
Posted: Fri Sep 05, 2003 12:09 pm
by NoReason
1) No additional Headers are begin sent.
2) No cookies are begin sent
3) Using the relitive path presents the same issue.
Posted: Tue Sep 09, 2003 6:36 pm
by NoReason
Just whant to make sure the no one has any idea what is happening.. ?