brandon.forerivertech Posted December 9, 2016 Report Posted December 9, 2016 This is very strange, all other crons are working besides this one. I checked the script (no issues) I can run it manually. However it wont automatically run. Nothing specific just the entire */5 * * * * /usr/bin/php /home/********/public_html/clients/index.php cron Is not running. If this has been encapsulated elsewhere I was unable to find it via a search. Regards, Brandon Quote
1 Allan Posted December 9, 2016 Report Posted December 9, 2016 I had the same problem at first I went and did some digging around and found that if you add /local between /usr/bin it worked. /usr/local/bin/php /home/ Michael 1 Quote
1 Chris van der Westhuizen Posted March 6, 2018 Report Posted March 6, 2018 Using apache2, php 7.0.16 on blesta 4.1.2 on Ubuntu. I also run the cron job with no results or error results although it gets executed each 5min blesta says the cron job run on the time I last ran it manually. Even when running from ssh as: /usr/bin/php -q /var/www/html/billing/index.php cron > /dev/null 2>&1 I then run it again in ssh but without the > /dev/null 2>&1 and receiving the "error: the ionCube PHP Loader needs to be installed..." although I know it is installed because blesta is working then. I remember then there is different versions of php, thus running php -i | grep -i 'php.ini' with result:Configuration File (php.ini) Path => /etc/php/7.0/cli Loaded Configuration File => /etc/php/7.0/cli/php.ini the ioncube modules is not loaded for php cli, I then added the following at the top of the php.ini file zend_extension = /usr/lib/php/20151012/ioncube_loader_lin_7.0.so Then when I ran the cron job, it actually gives me the same results as when I run it manually. I then included the > /dev/null 2>&1 at the end, and since then my cron job problem was sorted. :-) Blestax3 1 Quote
0 Michael Posted December 9, 2016 Report Posted December 9, 2016 Correct as Allan said, I believe you are using cPanel they don't seem to like using the default Linux PHP location. brandon.forerivertech and Allan 2 Quote
0 brandon.forerivertech Posted December 9, 2016 Author Report Posted December 9, 2016 Strange enough, I didnt even think of that Appreciate it Allan! Michael and Allan 2 Quote
0 Allan Posted December 9, 2016 Report Posted December 9, 2016 9 minutes ago, brandon.forerivertech said: Strange enough, I didnt even think of that Appreciate it Allan! No problem I am still learning as I go and like to help when I can. Michael and brandon.forerivertech 2 Quote
0 Dany Kurniawan Posted December 19, 2016 Report Posted December 19, 2016 On 9/12/2016 at 7:51 AM, Allan said: I had the same problem at first I went and did some digging around and found that if you add /local between /usr/bin it worked. /usr/local/bin/php /home/ permit me to ask Allan. So, i have to add the word "local" in the server cpanel cron job or in the admin setting of blesta? i try in the admin setting of blesta, but it can't be changed. Quote
0 Paul Posted December 20, 2016 Report Posted December 20, 2016 26 minutes ago, Dany Kurniawan said: permit me to ask Allan. So, i have to add the word "local" in the server cpanel cron job or in the admin setting of blesta? i try in the admin setting of blesta, but it can't be changed. What's displayed in Blesta under Settings > System > Automation is the recommended command for setting up your cron. You can't change that. You can copy/paste that into creating a cron job on your server, but you should make sure the path to PHP is correct. Quote
0 Dany Kurniawan Posted December 20, 2016 Report Posted December 20, 2016 20 minutes ago, Paul said: What's displayed in Blesta under Settings > System > Automation is the recommended command for setting up your cron. You can't change that. You can copy/paste that into creating a cron job on your server, but you should make sure the path to PHP is correct. so, i have to delete cron job default when the first time i install blesta? below is the cron job default by blest installation Quote
0 Paul Posted December 20, 2016 Report Posted December 20, 2016 10 minutes ago, Dany Kurniawan said: so, i have to delete cron job default when the first time i install blesta? *capture2.png is the default cron job that created by blesta when first time install Blesta doesn't create cron jobs (Unless you installed via Softaculous or Installatron?) This looks fine though, assuming cron can find php. Otherwise, you may need to put the full path to php instead. Is it not working? You can see the last run time under Settings > System > Automation. Quote
0 Dany Kurniawan Posted December 20, 2016 Report Posted December 20, 2016 13 minutes ago, Paul said: Blesta doesn't create cron jobs (Unless you installed via Softaculous or Installatron?) This looks fine though, assuming cron can find php. Otherwise, you may need to put the full path to php instead. Is it not working? You can see the last run time under Settings > System > Automation. Yes, i install blesta with Softaculous. Hehehe... yesterday i realize that cron not run since 1 week. so i decide to run it manually from Settings > System > Automation. Until now, the cron status still showing like this. until now, it has no change. otherwise, it's been 1 day after i run that cron. Quote
0 Paul Posted December 21, 2016 Report Posted December 21, 2016 On 12/19/2016 at 4:26 PM, Dany Kurniawan said: Yes, i install blesta with Softaculous. Hehehe... yesterday i realize that cron not run since 1 week. so i decide to run it manually from Settings > System > Automation. Until now, the cron status still showing like this. until now, it has no change. otherwise, it's been 1 day after i run that cron. I'd suggest trying to run the cron command via SSH as the same user, and see if it works. If it doesn't then your cron may be wrong, if it does, then your cron may not actually be running even though it's set up. Quote
0 S.H. Posted March 6, 2018 Report Posted March 6, 2018 4 hours ago, Chris van der Westhuizen said: Then when I ran the cron job, it actually gives me the same results as when I run it manually. I then included the > /dev/null 2>&1 at the end, and since then my cron job problem was sorted. :-) It is my understanding that ">/dev/null 2>&1" only redirects the output of the script to /dev/null which means you just won't see an error if there was one, not that the script is working as it should. I can suggest running a phpinfo page from the same folder as your blesta install to investigate the location of the php it is using. I'm using Cpanel as well and my php is located at "/opt/alt/php56/usr/bin/php" which I was able to discover after using phpinfo. Tyson 1 Quote
0 Chris van der Westhuizen Posted March 9, 2018 Report Posted March 9, 2018 On 3/6/2018 at 6:12 PM, S.H. said: It is my understanding that ">/dev/null 2>&1" only redirects the output of the script to /dev/null which means you just won't see an error if there was one, not that the script is working as it should. I can suggest running a phpinfo page from the same folder as your blesta install to investigate the location of the php it is using. I'm using Cpanel as well and my php is located at "/opt/alt/php56/usr/bin/php" which I was able to discover after using phpinfo. You are correct about the ">/dev/null 2>&1". I should have my last sentence to read " at the end, and since then and after doing all of the above my cron job problem was sorted. " I just removed momentarily the >/dev/null 2>&1 to give me visible results. :-) thanks Regarding the php.ini file for the cron job path. phpinfo from the website returns: Configuration File (php.ini) Path /etc/php/7.0/apache2 Loaded Configuration File /etc/php/7.0/apache2/php.ini whereas through ssh command: php -i | grep -i 'php.ini' returns: Configuration File (php.ini) Path => /etc/php/7.0/cli Loaded Configuration File => /etc/php/7.0/cli/php.ini when using the latter path from ssh command my cron job was running correctly. Paul 1 Quote
Question
brandon.forerivertech
This is very strange, all other crons are working besides this one. I checked the script (no issues) I can run it manually. However it wont automatically run.
Nothing specific just the entire
*/5 * * * * /usr/bin/php /home/********/public_html/clients/index.php cron
Is not running.
If this has been encapsulated elsewhere I was unable to find it via a search.
Regards,
Brandon
13 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.