Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   CRON error (https://www.warriorforum.com/programming/473665-cron-error.html)

Shounak Gupte 21st October 2011 02:43 AM

CRON error
 
This cron used to work till yesterday. It suddenly stopped working. I am getting the following output. Any ideas?

/bin/sh: /usr/local/bin/php: No such file or directory

freehugs 21st October 2011 07:42 AM

Re: CRON error
 
Hmm, I don't know what distro of linux you are using, but generally PHP is installed in /usr/bin/php not /usr/local/bin/php. Perhaps you had a symlink there that disappeared?

KirkMcD 21st October 2011 12:35 PM

Re: CRON error
 
Ask your host.

wasabi20 10th November 2011 07:32 AM

Re: CRON error
 
Add:

#!/usr/bin/php

in the top of your php file ;)

Good luck ;)

casius 8th December 2011 03:21 PM

Re: CRON error
 
Actually, what you need to do is to find the right the path for your PHP location. As I see that either your PHP path is incorrect or the path to your executable file is incorrect. By the way to find the right path of PHP check PHP info of your web hosting provider ;)

RobKonrad 8th December 2011 06:51 PM

Re: CRON error
 
1. Create a simple php file called info.php with the following content:

<?php
phpinfo();
?>

2. Copy this file to your web server.

3. Then open this php file with your browser.

Inside the report you will see path to php.ini in the row called
Configuration File (php.ini) Path.

Cheers,
Rob

msam029 8th December 2011 07:08 PM

Re: CRON error
 
Yes the php is mostly /usr/bin/php in cent and ubuntu flovours try getting it by whereis php or from php info

jrim 8th December 2011 07:41 PM

Re: CRON error
 
Just wanted to chime in that you can also try running the cron command with the prefix of the path to php, e.g. instead of only having your cron script use the path to the file as the argument, try something like:

Code:

28 14 * * * /usr/local/bin/php -q /yourscript.php
(or whatever the path to your php bin is)

-q flag suppresses HTTP header output.

ezkl 9th December 2011 01:23 PM

Re: CRON error
 
Provided you have ssh access, login and run:
Code:

which php
This will return the full path to the php binary.


All times are GMT -6. The time now is 06:46 PM.