HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   General (http://www.howtoforge.com/forums/forumdisplay.php?f=25)
-   -   Cron job not working (http://www.howtoforge.com/forums/showthread.php?t=60314)

Hoox 23rd January 2013 14:29

Cron job not working
 
I need to setup a cron job from a php file. This is the line I need to run (from documentation): php /var/www/clients/client3/web24/web/cron.php >/dev/null 2>&1

I have set Client limit to chrooted cron in ISPConfig.

I tried manually editing the cron file to /usr/bin/php /var/www/clients/client3/web24/web/cron.php >/dev/null 2>&1.
Also tried with both full path and /web/cron.php >/dev/null 2>&1.

till 23rd January 2013 15:27

First, a cronjob (does not matter if you use ispconfig) has always to contain full paths, so it always have to start with "/usr/bin/php", so you have to enter in ISPConfig:

/usr/bin/php /var/www/clients/client3/web24/web/cron.php

To use the php binary (which is outside of the web root), you have to ensure that you create it as full cron and not jailed cron.

But my recommendation is something else, as the cron.php file is in the web directory, the easiest and secure way to set this up is a url cron. For a url cron, you just put the url to this script in the cron command line in ispconfig. e.g.:

http://www.yourdomomain.tld/cron.php

and ispconfig will create a cronjon that calls this url.


All times are GMT +2. The time now is 19:34.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.