I have a php script, and need to run it everyday. This script has a soapclient, and it works fine if I run it as a script using browser directly. However, some fatal errors if I set it as a cron job.
The script is very simple as "crontest.php"
<?php
$mage_url = 'http://******.com/api/?wsdl';
$mage_user = '*****';
$mage_api_key = '******';
$soap = new SoapClient( $mage_url );
echo "success";
exit;
?>
And the cronjob I set is
0 8 * * * /usr/bin/php /home/duan/public_html/scripts/crontest.php
The error it gives is
Fatal error: Class 'SoapClient' not found in /home/duan/public_html/scripts/crontest.php
It works fine if I remove line
$soap = new SoapClient( $mage_url );
Anyone can help?