eshop2k9 Posted September 3, 2009 Share Posted September 3, 2009 Hi Folks,Please help on this error.. I have installed prestashop 1.2.2 on windows hosting. I was able to install successfully and shopping cart is working fine including Admin module. The problem is when customer tried to login authentication.php is throwing an error CGI Error:the specified CGI application misbehaved by not returning a complete set of HTTP headers.Anyone could assist me on this.. it's an urgent issueMany thanks in advance Link to comment Share on other sites More sharing options...
eshop2k9 Posted September 11, 2009 Author Share Posted September 11, 2009 hi folks Actually, i have hosted prestashop in windows hosting, Managed to figure out root cause authentication.php, replaced the following script, if (!$authentication OR !$customer->id) $errors[] = Tools::displayError('authentication failed'); else { $cookie->id_customer = intval($customer->id); $cookie->customer_lastname = $customer->lastname; $cookie->customer_firstname = $customer->firstname; $cookie->logged = 1; $cookie->passwd = $customer->passwd; $cookie->email = $customer->email; if (Configuration::get('PS_CART_FOLLOWING') AND (empty($cookie->id_cart) OR Cart::getNbProducts($cookie->id_cart) == 0)) $cookie->id_cart = intval(Cart::lastNoneOrderedCart(intval($customer->id))); $id_address = intval(Address::getFirstCustomerAddressId(intval($customer->id))); $cookie->id_address_delivery = $id_address; $cookie->id_address_invoice = $id_address; Module::hookExec('authentication'); if ($back = Tools::getValue('back')) { // Tools::redirect($back); header("location: $back"); exit; } header("location: my-account.php"); exit; //Tools::redirect('my-account.php'); } Link to comment Share on other sites More sharing options...
osfer Posted September 17, 2009 Share Posted September 17, 2009 I'm trying to setup a shop on a windows host and get the same error. Can you please clarify your solution.Thanks Link to comment Share on other sites More sharing options...
eshop2k9 Posted September 17, 2009 Author Share Posted September 17, 2009 Hello FolksIssue has been resolved. We need to change PHP settings to run as ISAPI / Fast CGI in windows hostingThanks Link to comment Share on other sites More sharing options...
osfer Posted September 17, 2009 Share Posted September 17, 2009 Hi,What if we have no administration access to to the windows hosting? Link to comment Share on other sites More sharing options...
osfer Posted September 17, 2009 Share Posted September 17, 2009 Hi again,After some testing, here is what I found out:1 - I could only replicat the behaviour on windows machines (PHP on IIS)2 - It seems PHP on IIS does not like incomplete redirect headers3 - on the Tools.php files under classes I changed the following on the function redirectAdmin arround line 57. //replace this line header('Location: '.$url); //by the following $pageURL = 'http'; if ($_SERVER["HTTPS"] == "on") { $pageURL .= "s"; } $pageURL .= "://"; if ($_SERVER["SERVER_PORT"] != "80") { $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; } else { $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; } $chars = preg_split('//', $pageURL, -1, PREG_SPLIT_NO_EMPTY); $slash = 3; // 3rd slash $i = 0; foreach ($chars as $key=>$char) { if ($char == '/') { $j = $i++; } if ($i == 3) { $pos = $key; break; } } $url_base = substr($pageURL, 0, $pos); header('Location: '.$url_base.$url); //end replaced code For a simple solution you can hardcode the main base address but this will get it running on all cases.hope it works for other as well. Link to comment Share on other sites More sharing options...
kevin C. Posted May 20, 2010 Share Posted May 20, 2010 Hey, am running ps 1.2.5 and got this "CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers." message sometimes in the ps admin after trying to save some modifications. Tried to modify tools.php but it was just braking the whole site. Any clue ? Link to comment Share on other sites More sharing options...
Sri Wulandari Posted May 21, 2010 Share Posted May 21, 2010 @kwin Hello FolksIssue has been resolved. We need to change PHP settings to run as ISAPI / Fast CGI in windows hostingThanks If you don't hava access, ask your host to do it. Link to comment Share on other sites More sharing options...
kevin C. Posted May 22, 2010 Share Posted May 22, 2010 thanks for that, will give it a try. Link to comment Share on other sites More sharing options...
taoreflex Posted July 8, 2010 Share Posted July 8, 2010 osfers tools.php fix also compeletely screwed my site. Once reverted was back to same error. Link to comment Share on other sites More sharing options...
taoreflex Posted July 8, 2010 Share Posted July 8, 2010 @kwinHello FolksIssue has been resolved. We need to change PHP settings to run as ISAPI / Fast CGI in windows hostingThanks If you don't hava access, ask your host to do it. Sorry, that's impossible. Its not on the list of system requirements for running Prestashop. A lot of hosts don't support ISAPI, so its not as simple as just change settings or getting your host to do it. It would mean changing hosting company, and I'm sure the Prestashop guys wouldn't let people go through the whole setup process, only to find that it doesn't work properly. That's why they give you the system requirements before you download! Link to comment Share on other sites More sharing options...
Recommended Posts