PHP and PEAR package RSS

Associate
Joined
6 Dec 2002
Posts
661
Location
Belfast
I can't seem to get the XML\RSS.php PEAR package to work. I've downloaded it fine but I can't seem to get the require_once directive to import the package. I also downloaded the DB.php PEAR package and this works perfectly. Any ideas?
 
I'm not actually getting an error message. I'm bit of a PHP newbie so is there somewhere I should turn on error messaging?

Basically what I have are two files, db_test.php and rss_test.php:

db_test.php
Code:
<?php
require_once 'DB.php';
echo 'hello!';
?>
rss_test.php
Code:
<?php
require_once 'XML/RSS.php';
echo 'hello!';
?>
When I launch the db_test.php I see the "hello!" output but not when I run the rss_test.php. I also tried running the following script using the RSS.php package:
Code:
<?php
require_once 'XML/RSS.php';

echo 'hello!';

$rss =& new XML_RSS("http://slashdot.org/slashdot.rdf");
$rss->parse();

echo "<h1>Headlines from <a href=\"http://slashdot.org\">Slashdot</a></h1>\n";
echo "<ul>\n";

foreach ($rss->getItems() as $item) {
    echo "<li><a href=\"" . $item['link'] . "\">" . $item['title'] . "</a></li>\n";
}

echo "</ul>\n";
?>
When this script didn't work I knew something wasn't right.

Any help is much appreciated.
 
As far as I can remember I tried downloading the RSS package using the install command but it complained about dependencies, so I tried the --alldepends switch but I got a message saying that it was unable to download dependencies. Therefore I used the install command to download the dependencies first and then the RSS package. This seemed to work fine but I guess this might be where the problem lies.

Is it possible to just try downloading the package again using the --alldepends switch over the top of the existing install? If so I'll try this tonight when I get home from work.
 
Got it working guys. The XML_Parser was missing. I had to download his package separately as --alldeps didn't seem to work. Anyway it's working now so thanks everyone for the input.
 
Back
Top Bottom