0

i'm running the suitecrm 7.1.1 on IIS 7.5 on windows 2008 server. trying to run the cron.php to make the AOD works; The Cron batch file is killing me guys; from the admin>scheduler i put all the 11 jobs to inactive and kept only 2 jobs to active ( Perform lucene Index and Optimize AOD Index ) just the jobs required for the AOD to work in global search. i created a cron batch file with the following lines:

 cd c:\Program Files (x86)\PHP\v5.3
 php-cgi.exe -f c:\suitecrm\cron.php

I tested these two line with cmd prompt and the out put was cron.php is CLI Only i find in some threads that the workaround for this issue is to comment out these lines from the cron.php file with // as follows:

//$sapi_type = php_sapi_name();
//if (substr($sapi_type, 0, 3) !='cli') {
// sugar_die("cron.php is CLI only.");

When running with the cmd prompt don't show any message, nothing in the log file but the windows task scheduler results is (0xFF) after each time is executed. Now. i don't know if the cron is running or not and if this setup is correct and nothing is missing? can anyone tried this cron on windows help me please!

Josh Crozier
  • 233,099
  • 56
  • 391
  • 304
RedOne
  • 31
  • 1
  • 8

2 Answers2

0

Try php.exe -f c:\suitecrm\cron.php instead of php-cgi.exe

Full documentation for working with Schedulers is available at the SugarCRM Website at Sugar Community Edition 6.5 Administration Guide.

Matthew Poer
  • 1,682
  • 10
  • 17
  • thank you for your help...already tried this but no success. still can't find out if it does run the cron or not – RedOne May 14 '14 at 10:52
  • If you're not sure whether if not it's running, put your sugar log into debug level, run cron, and then check your sugarcrm.log file to see what happened. – Matthew Poer May 14 '14 at 11:42
  • Got lost in this hug file getting updated by 100 line every second...can you point me to something to determine if it is running properly or something missing? thank you!! – RedOne May 14 '14 at 12:15
  • If it is being updated, something must be running. Is your system live/in-use? If not, that's cron running that is causing the logging. – Matthew Poer May 14 '14 at 12:56
  • what the cron debug log look like? 05/14/14 18:34:52 [368][-none-][DEBUG] Found cache backend SugarCacheAPC 05/14/14 18:34:52 [368][-none-][DEBUG] Found cache backend SugarCacheFile 05/14/14 18:34:52 [368][-none-][DEBUG] Found cache backend SugarCacheMemcache 05/14/14 18:34:52 [368][-none-][DEBUG] Found cache backend SugarCacheMemcached 05/14/14 18:34:52 [368][-none-][DEBUG] Found cache backend SugarCacheMemory 05/14/14 18:34:52 [368][-none-][DEBUG] Using cache backend SugarCacheMemory, since 999 is less than 1000 05/14/14 18:34:52 [368][-none-][DEBUG] Found cache backend SugarCacheRedis ... – RedOne May 14 '14 at 15:37
  • I guess it is working now since the Windows scheduler says results succesful (0x0) but the log is not updating anymore. i used php.exe instead of php-cgi.exe and remove the // from the cron.php add before (see the post). – RedOne May 14 '14 at 15:54
0

I haven’t been able to use the php.exe either in windows. As an alternative, I use the Task Scheduler. When creating a new one, the Actions tab looks something like this,

Program/script:  "C:\Program Files (x86)\Internet Explorer\iexplore.exe"
Add arguments (optional):  http://localhost/backlog/loadclosedtickets.php

It will then load up that page at the time specified in the Triggers tag. If you want the script to self-close after running, use,

echo "<script>window.open('', '_self', ''); window.close();</script>";
James
  • 110
  • 1
  • 2
  • 13
  • thank you for the answer, but no succes, firefox/IE coulden't open the page, when tried doing it manullay (type the url: http://localhost/crm/cron.php it says no permission to access directories..from remote pc http://x.x.x.x/cron.php is redirected to http://x.x.x.x/index.php. after enabling directory browsing from the server it says not found...am I missing something ? – RedOne May 14 '14 at 10:47
  • Without modifying core files, you will not be able to call cron.php from a web browser. It checks for that as a security precaution. The loadclosedtickets.php file mentioned here is not a SugarCRM file, must be something custom. – Matthew Poer May 14 '14 at 11:46