Path to PHP

software development

#1

I’ve had a cron setup to run a php script and just recently it started failing because it can’t find php.

This is the error i’m getting.
/bin/sh: line 1: /usr/local/bin/php: No such file or directory

I typed whereis php from the cmd line and I only got directories. I couldn’t find the php cli binary.

Anyone know how I can fix this?


#2

Give the line you entered into Cron so that someone can tell you if there is a typo in your input.


Norm

Opinions are my own views and are not the views of DreamHost.
Any advice offered by me should be acted upon only at your own risk.


#3

0 0 * * * /usr/local/bin/php /home/user/db_backups/gifdump.php > /dev/null


#4

Is db_backups in your web root directory (example.com) or under it?

Does ‘which php’ from the command line show the path okay?


Norm

Opinions are my own views and are not the views of DreamHost.
Any advice offered by me should be acted upon only at your own risk.


#5
  1. Yes, it’s in the correct directory. (like i said earlier, this cron was working perfectly for a month or so and just started failing a few days ago.)
  2. When I type which php it doesn’t return anything on the cmd line.

Any other ideas?


#6

Might be worth a call to support in that case if which php is not returning anything.


Norm

Opinions are my own views and are not the views of DreamHost.
Any advice offered by me should be acted upon only at your own risk.


#7

Submitted a help desk ticket and they have fixed the issues.