I have a PHP script that I need to run every minute. I have made sure that the script works from the command line, and I\'m using absolute paths to avoid any environment iss
There are usually a significant number of things you need to do to move an executable from the command line to a cron job.
By default, cron jobs get a minimal environment which will almost certainly not have the full path (and a host of other environment variables) that your login sessions have. You may also not be in the same directory (as you have discovered).
What I tend to do is to execute:
env | sed 's/^/export /' >$HOME/cron.env
from a login session to get the full environment, then make sure that my cron jobs execute that script before attempting to do the real work. The resultant script may need a small amount of tidying up (quoting, removing transient environment variables like _ and PWD and so forth).
That way I can be sure that the login and cron environments are identical.