Problem With Cron Triggering PHP Script

I’ve got some CRON events setup to run which simply run a php script on my server which does some data scraping (Twitter API, Google API, etc…)

The CRON is running the scripts at my desired times but I keep receiving emails from my server. When I try to run the scripts directly from shell (php myfile.php) I’m getting these errors:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/apc.so' - /usr/lib/php/modules/apc.so: cannot open shared object file: No such file or directory in Unknown on line 0

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/php_curl.dll' - /usr/lib/php/modules/php_curl.dll: cannot open shared object file: No such file or directory in Unknown on line 0

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/php_mcrypt.dll' - /usr/lib/php/modules/php_mcrypt.dll: cannot open shared object file: No such file or directory in Unknown on line 0

The code inside one of the files throwing this error:


#!/usr/local/bin/php
<?php


        define('ga_email','--myconnectiondata--');
        define('ga_password','--myconnectiondata--');
        require '../includes/top.php';
        require '../includes/gapi.class.php';

        $ga = new gapi(ga_email,ga_password);

        $sql = mysql_query("SELECT * FROM sys_google_profiles") or die(mysql_error());
        while($row=mysql_fetch_array($sql)) {

                // GET THE GOOGLE PROFILES FOR THIS CLIENT
                $start_date = date("Y-m-d", time() - (60*60*24));
                $end_date = date("Y-m-d", time() - (60*60*24));

                $ga->requestReportData($row['ga_profile_id'],array('visitCount'),array('pageviews','visits'), null, null, $start_date, $end_date);

                $views = $ga->getVisits();
                $pageViews = $ga->getPageViews();

                mysql_query("INSERT INTO sys_google_stats (id, user_id, sys_google_profile, views, pageViews, `date`) VALUES ('', '".mysql_real_escape_string($row['user_id'])."', '".mysql_real_escape_string($row['id'])."', '".mysql_real_escape_string($views)."', '".mysql_real_escape_string($pageViews)."', '".mysql_real_escape_string($end_date)."')") or die(mysql_error());

        }


        ?>

The scripts run FINE from browser.

I’m running CENT OS.

Thanks

Are you cron’ing this from root?

yes