I have looked hi and low to see if anyone has had and solved this problem and cant find anything on the subject. I am using magento 1.3.2.4 and a custom theme. I have server rewrites turned on and I am using search engine friendly URL’s All of the website works fine EXCEPT for the RSS feeds which result in a 500: Internal Server ERROR when I try to view them. I think this has something to do with .htaccess but Idont have a clue what to do or what to reconfigure. If anyone has had this problem or may have a clue as to how to solve it, I would be forever grateful
I have a Mage CE 1.3.2.4 clean Installation and i have the same problem, when I click on “get feed” i got a Error 500! Internal Server Error!
I have, Lamp, Debian Lenny and fcgi mod the logs say:
[Fri Jan 29 17:14:39 2010] [error] [client xxxxxxxxxxxxxx FastCGI: comm with server “/var/www/fcgi/domain.net/php5-fcgi-starter” aborted: error parsing headers: duplicate header ‘Content-Type’, referer: http://domain.net/m1324/rss/
[Fri Jan 29 17:15:13 2010] [warn] FastCGI: (dynamic) server “/var/www/fcgi/domain.net/php5-fcgi-starter” (pid 17651) termination signaled
[Fri Jan 29 17:15:13 2010] [warn] FastCGI: (dynamic) server “/var/www/fcgi/domain.net/php5-fcgi-starter” (pid 17651) terminated by calling exit with status ‘0’
When accessing a rss feed, Magento sends a header
Content-Type text/html; charset=UTF-8
(in file \app\code\core\Mage\Core\Model\App.php, line 1189)
which is an appropriate header when viewing the website, but not necessary for rss.
and then another another one:
Content-type text/xml; charset=UTF-8
(in file \app\code\core\Mage\Rss\controllers\CatalogController.php, Line 45)
which is necessary for the rss feed.
Sending two headers of the same type is generally not a problem - when you run PHP as module or ass CGI, duplicate headers are filtered such that only the last header is sent. It is known that fastcgi has problems if you send two ‘status’ headers (and Magento has implemented a fix for that) , but your error message seems to indicate that the same is true for multiple content-type headers.
You could maybe try to unset the first content-type header in the rss controller but I do not know enough about the Magento internals or fastcgi to know the implications of that, sorry.
When accessing a rss feed, Magento sends a header
Content-Type text/html; charset=UTF-8
(in file \app\code\core\Mage\Core\Model\App.php, line 1189)
which is an appropriate header when viewing the website, but not necessary for rss.
and then another another one:
Content-type text/xml; charset=UTF-8
(in file \app\code\core\Mage\Rss\controllers\CatalogController.php, Line 45)
which is necessary for the rss feed.
Sending two headers of the same type is generally not a problem - when you run PHP as module or ass CGI, duplicate headers are filtered such that only the last header is sent. It is known that fastcgi has problems if you send two ‘status’ headers (and Magento has implemented a fix for that) , but your error message seems to indicate that the same is true for multiple content-type headers.
You could maybe try to unset the first content-type header in the rss controller but I do not know enough about the Magento internals or fastcgi to know the implications of that, sorry.
Claudia
Claudia,
thanks for the tip i will try unset to see what happend, i run fcgi and all magento works well so far except the RSS feed.
Thank you agan
Nuno
############## EDIT: #############
if i comment the line in file /app/code/core/Mage/Rss/controllers/CatalogController.php, Line 45
ex:
// $this->getResponse()->setHeader(’Content-type’, ‘text/xml; charset=UTF-8’);
Just work fine, no more errors and i get the feed out.
if i comment the line in file /app/code/core/Mage/Rss/controllers/CatalogController.php, Line 45
ex:
// $this->getResponse()->setHeader(’Content-type’, ‘text/xml; charset=UTF-8’);
Just work fine, no more errors and i get the feed out.
I am not sure but IMO commenting out this line will give you a feed that is delivered with content type text/html which might cause problems with some rss readers. So make sure to test your feed with a couple of different rss apps.
By looking at the code moentioned in /app/code/core/Mage/Rss/controllers/CatalogController.php you can simply set the third parameter of the setHeader() method to TRUE to have it replace existing headers.
setHeader($name, $value, $replace = false) is used to set an individual header. By default, it does not replace existing headers of the same name in the object; however, setting $replace to TRUE will force it to do so.
[Mon Dec 20 07:14:41 2010] [error] [client 10.60.0.1] FastCGI: comm with server "/var/www/magento/cgi-bin/php-fastcgi" aborted: error parsing headers: duplicate header 'Status'
Received instead of 404 page, running FastCGI. Shaved a second off page load, doesn’t burden the server’s memory like mod_php, just doesn’t do 404 pages anymore.
Thank you Jeyhun for posting the link, Magento under FastCGI now 404’s once again.
When you receive a \"500 Internal Server Error\”, check for errors obvious and easily resolved, such as problems downloading a file executable-bit first. Once this is removed, there seems to be a syntax error or other problems in the script itself. The easiest way to track who is to provide the Perl interpreter to do the hard work: the script for your computer.
Actually, the fix was here. Magento has had a problem since 1.1.3 and despite a fix, still has it in 1.4.1.1. If you are running FastCGI, you will get duplicate status headers and duplicate content type headers, a big no-no in FastCGI as it expects properly formed HTTP headers. So, it throws a 500 error. It’s also a common problem among all the more well known blog software users when they try to use PHP executed under FastCGI.
I looked at the same issue for the XMLRPC API and a few other items. The fix to unset the duplicate headers does not work reliably, the thing that does work reliably is this:
in app/code/core/Mage/Api/Model/Server/Adapter/Xmlrpc.php where Magento sets the content-type header (this is the second time it is set, that is why the unset does nto work.), force it to REPLACE any content type headers already set:
That way it replaces the previous content type header and makes the XMLRPC Api work with fast-cgi.
The same method can be applied where ever else Magento tries to send duplicate headers. It might be worth trying to modify setHeaders() to always replace existing headers if the header is either status or content-type, since they are only allowed once anyway, but I don\\\\\\\’t have time to test that completely.