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'];

Here is a lengthier and possibly more current set of notes.

3 comments to Patching Refeed for PHP-CGI

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>