RSSLib - Cannot instantiate non-existent class
Hi there, I'm having issues with the RSS reader - it's a bit hit and miss I'm afraid as I can get this to work on one of my clients' sites but not on our own. When I try to read something I get the following error: Fatal error: Cannot instantiate non-existent class: domdocument in /home/resource/public_html/php-bin/rsslib.php on line 90 This happens irrespective of the feed I'm trying to use. We have PHP 5.3 installed on the server. Any help would be greatly appreciated as I cannot see any reason for this not to work properly. Many thanks, Martin
Hello, do you have tested the feed on the online version? It is the same code that in the archive to download but it helps to find issues coming from the configuration... [url=http://www.scriptol.com/rss/rss-single.php]http://www.scriptol.com/rss/rss-single.php[/url]
The feed works off your page, but does not seem to from mine. Do you understand the error below? I do PHP but haven't come across this error before nor do I know how to fix it. The only guidance I've had is if I was trying to run the script without PHP5 but I'm on 5.3 so that's not the issue.
You have to make some checks to see what happens. Try simple code as:
<?php echo "hello"; ?>You can also try the demo on your website or run some simple script using DOM functions. Maybe the server does not support DOMDocument?
PHP works fine on our server, as demonstrated by our homepage: www.moxby.org.uk How can I check if DomDocument is supported?
Try this code:
<?php $doc = new DOMDocument(); $doc->load('somefile.xml'); echo $doc->saveXML(); ?>somefile.xml may be any XML file the the script should display its contents.
That generates the same error:-
Fatal error: Cannot instantiate non-existent class: domdocument in /home/resource/public_html/php-bin/domdoc-test.php on line 2www.moxby.org.uk/php-bin/domdoc-test.php So... how can I fix this, do you think? Many thanks in advance!
The DOM XML parser is built in PHP 5 in order. You can verify it is enabled with this command:
<?php echo phpinfo(); ?>Scroll to the dom panel et look at the first row:
DOM/XML must be enabled.If it is not the case and I you have access to the server, PHP must be compiled with the right option. If it is a shared hosting, see at the admin panel.
I've found the configuration issue - thank you for your help - it was in my server's PHP config - I had to enable it as PHP5, although PHP5 was installed, it wasn't interpreting it as such. So I'm up and running now - thanks!