Forum

RSSLib - Cannot instantiate non-existent class

2010-04-10 09:38:57

moxbydesign

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
2010-04-10 14:06:37

scriptol

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=https://www.scriptol.com/rss/rss-single.php]https://www.scriptol.com/rss/rss-single.php[/url]
2010-04-12 12:35:10

moxbydesign

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.
2010-04-12 12:52:29

scriptol

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?
2010-04-12 13:01:59

moxbydesign

PHP works fine on our server, as demonstrated by our homepage: www.moxby.org.uk How can I check if DomDocument is supported?
2010-04-13 13:33:56

scriptol

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.
2010-04-20 07:28:03

moxbydesign

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 2
www.moxby.org.uk/php-bin/domdoc-test.php So... how can I fix this, do you think? Many thanks in advance!
2010-04-20 12:54:24

scriptol

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.
2010-04-20 14:34:16

moxbydesign

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!