0

A few weeks ago I noticed that the RSS feed on my live site was broken - I get a white screen of death. It had worked fine up until then. The rest of my site continues to work fine. Additionally the identical code continues to work perfectly on my dev box.

No code changes have occurred, so I'm guessing my web host have changed a server setting - but I've no idea what the setting may be (so I don't know if there's a workaround or if I need to ask my web host to change something). Both Prod & Dev are running PHP 5.3.8.

Could anyone give me a clue as to what that setting might be?

The only major difference I could see in the response headers was that my (non-working) Production RSS feed has this Response Header: "Accept-Ranges: none".

I've double-checked the DB call that populates the feed, and even replaced it with some static data within the class (just in case there was a DB problem), but it makes no difference.

Code for the relevant Controller method below:

    public function articlesAction(){
    $format = $this->_request->getParam('format');
    //default format to rss if unspecified
    $format = in_array($format, array('rss','atom')) ? $format : 'rss';

    $articles = new Application_Model_DbTable_Articles();
    $rows = $articles->getLatestArticlesForFeed();
        $channel = array(
            'title'         =>  'Feed of articles',
            'link'          =>  'http://www.mysite.co.uk',
            'description'   =>  'The latest articles and reviews from my site',
            'author'        =>  'My name',
            'language'      =>  'en',
            'ttl'           =>  '60',
            'copyright'     =>  '© the writers of the articles',
            'charset'       =>  'utf-8',
            'entries'       =>  array()
        );
        foreach ($rows as $item) {
            $articlelink = 'http://www.mysite.co.uk/articles/' . $item['stub'];
            $formattedlink = '<p><strong>Source: <a href="'.$articlelink.'">'.$articlelink.'</a></strong></p>';
            $channel['entries'][] = array(
                'title'         =>  $item['title'],
                'link'          =>  $articlelink,
                'guid'          =>  $articlelink,
                'description'   =>  $formattedlink . $item['content'] . '<p>© ' . $item['byline'] . ', ' . $item['copyright'] . '</p>' ,
                'lastUpdate'    =>  strtotime($item['date_published'])
            );
        }
        $feed = Zend_Feed::importArray($channel, $format);
        $feed->__wakeup();
    }
    $feed->send();
    $this->_helper->viewRenderer->setNoRender();
    $this->_helper->layout()->disableLayout();
}
Paul Watson
  • 361
  • 1
  • 3
  • 8
  • WSOD are most of the time because of some fatal error somewhere. Enable error reporting on your live site to find out where. Or just check out your logs – PeeHaa Dec 11 '11 at 19:36
  • Sorry - should have mentioned that I have already tried this. I set "phpSettings.display_startup_errors" and "phpSettings.display_errors" to 1 in my ZF application.ini file for Production and I *still* get the WSOD – Paul Watson Dec 11 '11 at 19:51
  • And is there something in your error log? Also try adding: `error_reporting(E_ALL);` – PeeHaa Dec 11 '11 at 19:58
  • I've just tried that, but still seeing WSOD and nothing in the error logs. – Paul Watson Dec 11 '11 at 20:05
  • Edit to add: looking in the log files (confirmed by checking the headers of the WSOD) I can see that the WSOD is returning a "200" HTTP response, so whatever is happening isn't actually triggering a "500" error. – Paul Watson Dec 11 '11 at 20:22
  • Did you ever manage to solve this problem? – halfpastfour.am Jan 16 '15 at 17:40
  • Yes, but it was so long ago I can't actually remember how. I think I was making a stupid error somewhere - I *think* it was something to do with how my .htaccess was set up - I had to change something to make the page display with the correct mimetype - or something along those lines – Paul Watson Jan 17 '15 at 19:04

1 Answers1

0

I wasted an hour once figuring out why I have a WSOD just because I initiated a class with one lowercase letter...

$table = new Model_DbTable_EshopSubcategories(); instead of

$table = new Model_DbTable_EshopSubCategories();

The dev server does not have to be case sensitive and the production server can.

Casso
  • 139
  • 6