Patching Refeed for PHP-CGI
If you’re not interested in Reblog, Refeed, or PHP-CGI, I recommend you skip this post.
Lately I’ve been working with various combinations of aggregators, tagging, ranking, and presentation systems. Here are some fixes for anyone who is trying to get Reblog / Refeed 1.3 running on a hosted web service.
I’m mostly using Dreamhost, which is presently running PHP 4.3.10, and offers a choice of PHP as an Apache module or PHP-CGI. These installation problems are likely to occur for anyone running Refeed in a PHP-CGI environment. The initial symptoms are that the HTTP authentication dialog will pop up when you try to view the Refeed control panel, independent of whether credentials are defined in init.php.
The main issues:
- Refeed installs and runs as packaged, but only if it’s running as an Apache module. This is a security problem in a shared hosting environment
- The security problem can be partly addressed by enabling PHP-CGI (which is the default at Dreamhost and other hosting services), but this breaks the default Refeed configuration
- The reason it breaks is because PHP’s built-in HTTP basic authentication fails during the initialization
- Another reason it breaks is because the $_SERVER['SCRIPT_NAME'] variable is set differently in a PHP-CGI environment.
The solution:
- Comment out the PHP HTTP authentication in init.php
- Add .htaccess, if desired
- Modify add.php to include
$_SERVER['SCRIPT_NAME'] = $_SERVER['SCRIPT_URL'];

































[...] Ho John Lee’s Weblog » Patching Refeed for PHP-CGI – tags: howto refeed reblog [...]
I can’t log in to your wiki.
I’m dying to know how to fix this issue.
I can’t register for the wiki and therefore not read it in full length. Any chance, you could mail me the article, or provide a registration feature for the wiki?