Hi,
Not really sure this is supposed to go in here or in the PHP section of the forum... anyway, on to my problem.
I made a script that uses the PHP function to read a RSS feed and create a xml from that RSS feed.
If I browse to my script with my browser e.g. http://www.example.com/myscript.php, the script loads. If I then check my FTP, the .xml file is created. If I then empty the file or delete it and I browse to my script again, the .xml file gets overwritten/recreated.
So far so good.
To automate this process, I created a cronjob to run every 5 minutes. My cronjob uses the following command:
/usr/local/bin/php /home/example/www/myscript.php
The cronjob has been running for a while but .xml file doesn't get updated. I checked the log files for the cronjob but there are no errors in it. In my control panel I have the option to run the cronjob straight away, so I do and I get the following result:
Output from command /usr/local/bin/php /home/example/www/myscript.php ..
X-Powered-By: PHP/4.4.8_pre20070816-pl1-gentoo
Content-type: text/html
<br />
<b>Fatal error</b>: Call to undefined function: simplexml_load_string() in <b>/home/example/www/myscript.php</b> on line <b>46</b><br />
Why does the cronjob "fail" when it loads my script but when I browse to my script everything works fine?
I'm using:
PHPVersion 5.2.5-pl1-gentoo
SimpleXML
Simplexmlsupportenabled
Revision $Revision: 1.151.2.22.2.35 $
Schema support enabled
curl
cURLsupport enabled
cURLInformation libcurl/7.16.4 OpenSSL/0.9.8g zlib/1.2.3
xml
XMLSupportactive
XMLNamespace Support active
libxml2 Version 2.6.30
Thanks in advance for any support.