tags:

views:

49

answers:

4

I have some code that gets a wordpress rss feed and displays the news articles on my own website. This code works fine on my development server that is running php 5.3.1 but when I upload it to my live website that only has php 4.4.9 I am getting lots of problems.

The code I have is based on MagpieRSS (http://magpierss.sourceforge.net)

Has anyone tried using MagpieRSS on php4 successfully or does anyone know what commands I should look for in my code that will not work in php4.

Any other help would be greatly appreciated.

A: 

well the main difference is that php 5 is object-oriented while php4 isn't. Maybe you're using OO code

astorcas
This is factually untrue. While OO is improved in PHP5, PHP4 has simple classes and objects.
Charles
@Charles: so you're saying it's not a true fact, then.
intuited
A: 

There is a good article here http://www.webmaster-talk.com/php-forum/78717-differences-between-php4-and-php5.html on the differences between php4 and php5

I've never tried MagpieRSS but on their Sourceforge page there is a mention of it running on PHP4

"MagpieRSS 0.52 Now Compatible with PHP 4.3.2"

Maybe you could try running an older version of it if the newer ones require PHP5?

Have you proven that its MagpieRSS thats causing the problem?

Gavin Draper
+2  A: 

The best resource for finding out what's different between PHP 4 and PHP 5 is the official migration guide. Most well-written PHP 4 code will run unmodified under PHP 5. Most average PHP 4 code will run under PHP 5 with either some settings changes or small code changes.

The biggest and most important difference is that PHP 4 was end-of-lifed at the end of 2007. You should not be running PHP 4 today, it has not been maintained since 2007. Please upgrade, PHP 5 was released in 2004. If you're on a commercial hosting provider, please ask them about upgrading PHP. If they are unable or unwilling to upgrade you to PHP 5, drop them like a rock.

Charles
+1  A: 

What are the problems you run into? Is it just that it 'doesn't work'? Or do you get specific error messages? To get full error messages you can put this code at the top of your script:

ini_set('display_errors', 1);
error_reporting(E_ALL|E_STRICT);

Maybe if we find out what exactly is going wrong, we can find you some fixes :)

BTW: I wholeheartedly agree with Charles' response, you really need to upgrade to PHP 5.x!

Dennis Haarbrink