[UPHPU] run PHP CLI with cron

Brandon Stout bms at mscis.org
Thu Nov 8 19:59:46 MST 2007


Wade Preston Shearer wrote:

> I have a PHP script that runs as intended and without errors when run 
> manually from the command line. When I set cron to run it, however, it 
> fails. It is my understanding that cron executes the script as the 
> user that set up the cron job. Is that true? What would be different 
> from when I run it manually compared to when cron is running it?
>
> wade

Does the script work when run manually?  What user do you run it as when
it works?  Look at how you are doing your crontab:

  * If you created it with crontab -e or crontab -i, then it will run as
the user that created the crontab.
  * If you run vim /etc/crontab as root, you can edit the system crontab
file, and specify the user

Brandon Stout
http://mscis.org



More information about the UPHPU mailing list