Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 21st Oct 2011, 02:43 AM   #1
Advanced Warrior
War Room Member
 
Shounak Gupte's Avatar
 
Join Date: 2010
Location: Melbourne, Australia
Posts: 688
Thanks: 367
Thanked 70 Times in 58 Posts
Default
CRON error
Share on: 
fb share twitter share gplus share more share

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
Shounak Gupte is offline  
Unread 21st Oct 2011, 07:42 AM   #2
Active Warrior
War Room Member
 
Join Date: 2011
Location: Tampa, FL
Posts: 33
Thanks: 3
Thanked 8 Times in 5 Posts
Default
Re: CRON error
Share on: 
fb share twitter share gplus share more share

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?
freehugs is offline  
Unread 21st Oct 2011, 12:35 PM   #3
VIP Warrior
War Room Member
 
Join Date: 2006
Location: , , USA.
Posts: 1,795
Thanks: 70
Thanked 287 Times in 259 Posts
Default
Re: CRON error
Share on: 
fb share twitter share gplus share more share

Ask your host.
KirkMcD is offline  
Unread 10th Nov 2011, 07:32 AM   #4
Senior Web Developer
War Room Member
 
wasabi20's Avatar
 
Join Date: 2011
Location: Quebec, Canada
Posts: 113
Thanks: 32
Thanked 19 Times in 17 Posts
Default
Re: CRON error
Share on: 
fb share twitter share gplus share more share

Add:

#!/usr/bin/php

in the top of your php file

Good luck
wasabi20 is offline  
Unread 8th Dec 2011, 03:21 PM   #5
HyperActive Warrior
 
casius's Avatar
 
Join Date: 2010
Posts: 131
Thanks: 0
Thanked 8 Times in 8 Posts
Default
Re: CRON error
Share on: 
fb share twitter share gplus share more share

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

Cloud VPS || Shared Hosting
Web Hosting Solutions for Geeks!
HOST1PLUS
casius is offline  
Unread 8th Dec 2011, 06:51 PM   #6
Marketing with an accent.
War Room Member
 
RobKonrad's Avatar
 
Join Date: 2010
Location: Switzerland
Posts: 556
Thanks: 103
Thanked 179 Times in 135 Posts
Default
Re: CRON error
Share on: 
fb share twitter share gplus share more share

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

================================================== ===
This blog is awesome: http://www.robkonrad.com/blog. Read it.
================================================== ===
RobKonrad is offline  
Unread 8th Dec 2011, 07:08 PM   #7
Warrior Member
 
Join Date: 2011
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: CRON error
Share on: 
fb share twitter share gplus share more share

Yes the php is mostly /usr/bin/php in cent and ubuntu flovours try getting it by whereis php or from php info
msam029 is offline  
Unread 8th Dec 2011, 07:41 PM   #8
Jrim Software
War Room Member
 
jrim's Avatar
 
Join Date: 2011
Posts: 26
Thanks: 9
Thanked 6 Times in 6 Posts
Default
Re: CRON error
Share on: 
fb share twitter share gplus share more share

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.

★ ★ [Proxy Software] ★ ★ [Proxy Lists] ★ ★
jrim is offline  
Unread 9th Dec 2011, 01:23 PM   #9
Warrior Member
 
Join Date: 2011
Posts: 5
Thanks: 0
Thanked 1 Time in 1 Post
Default
Re: CRON error
Share on: 
fb share twitter share gplus share more share

Provided you have ssh access, login and run:
Code:
which php
This will return the full path to the php binary.
ezkl is offline  
Closed Thread


Bookmarks

Tags
cron, error


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 09:29 PM.