crontab / auto fetch not working.
I have been trying hard to get the crontab running for email auto fetch for ticket creation but all efforts seems to be a waste after following instructions posted on this thread and copying the new cron.php file mentioned here by Peter.
The auto email works and ticket is generated if I login to Staff panel but not the case with crontab.
Details:
System: Linux red Hat 5.5
OSticket : 1.6
webserver: apache 2.2. with myssql database.
PHP : 5.1
cron.php
-------------
<?php
define('EX_CONFIG', 78);
if(!file_exists('../main.inc.php')) exit(EX_CONFIG);
require_once('../main.inc.php');
if(!defined('INCLUDE_DIR')) exit(EX_CONFIG);
require_once(INCLUDE_DIR.'class.cron.php');
Cron:();
Sys:(LOG_DEBUG,'Cron Job','External cron job executed ['.$_SERVER');
?>
crontab entry (set to run every 5 minutes)
---------------
*/5 * * * * nobody /usr/bin/php /var/www/api/cron.php
Checking the mail log, below is the error:
------------------------
Subject: Cron /usr/bin/php -c /var/www/appsupport/api/cron.php
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
PHP: Error parsing /var/www/appsupport/api/cron.php on line 2
--------------------------
Not sure which line-2 refers to as all files including main.inc.php exists in the directory.
I have also disabled - Enable POP/IMAP email fetch (Global setting which can be disabled at email level) to make sure cron tab runs as suggested in this post.
Also added extension=imap.so to my php.ini file at the end.
And after no luck after all. Not sure where the problem is.
I would appreciate if any one can help out in this case. And keeping the logged session active is really a pain.
Thanks
Babi