YetiForceCompany / YetiForceCRM

Our team created for you one of the most innovative CRM systems that supports mainly business processes and allows for customization according to your needs. Be ahead of your competition and implement YetiForce!
https://yetiforce.com
Other
1.73k stars 749 forks source link

[QUESTION] Cron does not work #4382

Closed gogroup-official closed 7 years ago

gogroup-official commented 7 years ago

In version dev 4.0.209, cron does not work even though version 3.4 is working properly. Look forward to help. phpError.php [27-Apr-2017 09:40:01 Asia/Bangkok] PHP Warning: session_start(): Cannot send session cookie - headers already sent in /home/**/*/libraries/HTTP_Session/Session.php on line 160 [27-Apr-2017 09:40:01 Asia/Bangkok] PHP Warning: session_start(): Cannot send session cache limiter - headers already sent in /home/**/*/libraries/HTTP_Session/Session.php on line 160

PHP 7.1 zalo_screenshot_27_4_2017_85039 zalo_screenshot_27_4_2017_855495

gogroup-official commented 7 years ago

who can help me.

jbmcclain commented 7 years ago

Depending on what you are using for web server you need to set your cron job to point to full serverparth\cron\vtigercron.php you will want to set it to run at your desired interval.

for me I use xampp on a windows box I created a bat file to run a bat file set VTIGERCRM_ROOTDIR="C:\xampp\htdocs\sitename" set PHP_EXE="C:\xampp\php\php.exe"

cd /D %VTIGERCRM_ROOTDIR%

%PHP_EXE% -f cron/vtigercron.php

gogroup-official commented 7 years ago

Thanks you. :)) I changed the file cron/vtigercron.sh

export VTIGERCRM_ROOTDIR=dirname "$0"/.. export USE_PHP=php

export USE_PHP=/usr/local/php53/bin/php

export USE_PHP=/usr/local/php56/bin/php56

cd $VTIGERCRM_ROOTDIR $USE_PHP -f cron/vtigercron.php

to

export VTIGERCRM_ROOTDIR=dirname "$0"/..

export USE_PHP=php

export USE_PHP=/usr/local/php53/bin/php

export USE_PHP=/usr/local/php56/bin/php56

export USE_PHP=/usr/local/bin/php

cd $VTIGERCRM_ROOTDIR $USE_PHP -q cron/vtigercron.php

In cronjob I use the command line *****/bin/sh /home/domaiin/crm/cron/vtigercron.sh and it's worked. :))

ldgbc commented 6 years ago

@jbmcclain Thanks. I followed his advice and got the CRON to run. Based on research (for future reference and anyone who is same as me)

I'm using the Complete XAMP 4.3 version at the moment. CRON isn't setup so you lose out on many feature (Global Search, etc). You must use CRON to index it the search and make your YetiForce perform some of it function.

Because I used the Complete XAMPP version there isn't a "sitename", so you remove it to:

set VTIGERCRM_ROOTDIR="C:\xampp\htdocs\sitename" set PHP_EXE="C:\xampp\php\php.exe"

cd /D %VTIGERCRM_ROOTDIR%

%PHP_EXE% -f cron/vtigercron.php

If you run the BAT and it auto close, it mean that you made a typo or error something (e.g. it should be D: drive but you used the C:) Anyway, after running, do a refresh on the CRON Setting page ( /index.php?module=CronTasks&parent=Settings&view=List&block=15&fieldid=26 ) and you should see "Last Scan" got a entry now.

If you want to automated then use your Windows Scheduler and get it to run. I was running this and typing these instruction, which has been about 3 minutes now but the BAT file still open. Not sure if I should wait or just End Task or shut it down.

Good luck all. Thanks.

EDIT: Did a refresh, current CRON job was at 20/30. So refresh the page till you get 30/30 and wait a bit I guess. Anyway it seem it going to take about 10-15 minutes or longer so I guess I leave it overnight.