Background Tasks Not Running

5 posts by 3 authors in: Forums > CMS Builder
Last Post: November 3, 2016   (RSS)

By Perchpole - October 14, 2016

Hello, All -

I'm just setting up a new cmsb site (v3.05) and I've noticed that the Background Tasks aren't running. I've set-up a cronjob but for some reason cron.php will not run. (NB: I can run it manually by putting the URL in the browser window.)

What seems odd is I CAN run another script in the same directory as cron.php via the cronjob.

It doesn't make sense. Is there a setting that I need to change?

Note, I have exactly the same type of cron set-up on a different site but with the same server host and that works fine. I've run a comparison between the 2 cron.php files and they are identical.

:0/

Perch

By Perchpole - November 1, 2016

Hi, Damon -

Thanks for getting back to me. I've set-up cron jobs on numerous CMSB installations before - but this one just won't work! I've tried every conceivable permutation but cron.php simply will not run.

As I've said previously, I can drop a test script into the same directory as cron.php and that does run from the cronjob. The code looks like this:

* * * * * /usr/bin/php5 /homepages/path/htdocs/cmsb/cron.php
* * * * * /usr/bin/php5 /homepages/path/htdocs/cmsb/cronTest.php

The cronTest.php file runs fine - but there's not a peep from cron.php.

Out of interest, when I run cron manually the web interface suggests I should use this:

php -q /homepages/path/htdocs/cmsb/cron.php

Whereas the Background tasks suggests this:

/usr/bin/php /homepages/path/htdocs/cmsb/cron.php

I've tried these (and plenty of other permutations) and it just doesn't work.

:0/

Perch

By Perchpole - November 1, 2016

Damon -

I think I've cracked it! The 1&1 server requires a declaration of the specific php version required to run the script:

* * * * * /usr/bin/php5.5 /homepages/path/htdocs/cmsb/cron.php

Works fine now! Perhaps worth making a note of for future reference?

:0)

Perch

By Dave - November 3, 2016

Thanks Perch, 

We try to guess the path the PHP on the server, but can't always tell.  So it's always advisable to go with what your webhost recommends if the default doesn't work.

Just out of curiosity, if you "find in page" on php info here: admin.php?menu=admin&action=phpinfo Is there any references to "php5.5"? 

And glad you got it working!  Cheers

Dave Edis - Senior Developer
interactivetools.com