NickZA Posted December 5, 2007 Share Posted December 5, 2007 Hi All. I am using the following code running PHP under IIS, and get the following error: CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. I presume the problem is an obvious one... am I doing something wrong in the way I send the HTTP header? P.S. This works perfectly on my local machine under a recent version of WAMP. <?php /* Redirect to a different page in the current directory that was requested */ $host = $_SERVER['HTTP_HOST']; $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\'); $extra = 'index.php'; header("Location: http://$host$uri/$extra"); exit; ?> Any help would be greatly appreciated -- deadline in 2 days... :-\ Thank you, -Nick Quote Link to comment https://forums.phpfreaks.com/topic/80263-solved-cgi-error-on-a-simple-5-line-script-under-iis/ Share on other sites More sharing options...
Cep Posted December 7, 2007 Share Posted December 7, 2007 Are you redirecting to a page on your server or a page on an external server? Quote Link to comment https://forums.phpfreaks.com/topic/80263-solved-cgi-error-on-a-simple-5-line-script-under-iis/#findComment-408778 Share on other sites More sharing options...
NickZA Posted December 7, 2007 Author Share Posted December 7, 2007 Cep, Thanks, it was just a path issue, I sorted it out not long after posting. Cheers, -Nick Quote Link to comment https://forums.phpfreaks.com/topic/80263-solved-cgi-error-on-a-simple-5-line-script-under-iis/#findComment-408781 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.