I have a script which drives something in Suite CRM which I can run easily from the command line by just typing php script.php.
However when I run it using the cron, it fails after the line
echo "Defined sugarEntry\n";
I have also tried hard coding the path in the require statements and also tried require_once.
I've also set the relevant include path in /etc/php.ini, and this is the php that is being used in the cron. Is there anything else I am missing?
<?php
//Don't forget to set the include path in /etc/php.ini
echo "Start \n";
set_include_path(get_include_path() . PATH_SEPARATOR . $full_path);
echo "Include path set to " . get_include_path()."\n";
//error_reporting(E_ERROR);
if(!defined('sugarEntry'))
define('sugarEntry', true);
echo "Defined sugarEntry\n";
require( 'include/entryPoint.php');
echo "Entry point included\n";
require( 'custom/modules/Accounts/controller.php');
echo "Include file set\n";
$controller = new AccountsController();
echo "AccountsController initialised\n";
//$controller->debug = true;
//Loop through all the Accounts records that are a customer
$controller->sync_all_crm_to_smb();
echo "Finished\n";
?>