Re: I'm prepared to feel like an idiot... But I just simply need the answer :)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, August 1, 2007 7:49 am, Jason Pruim wrote:
> I have a php script that I am attempting to run from the CLI to
> connect to a MySQL database and update a field. but when I run it
> with this command: php cronjob.php it prints out the script on screen
> but doesn't process it...
>
> Running: php-r"phpinfo();" prints out the standard phpinfo screen..
> and I don't think I should have to write it differently to make it
> run from the command line right?
>
> HELP! I'm desperate... I would offer to name my first born after
> you... But he's already been born :)

#1
Can you copy/paste the exact command from "crontab -l" without the
first 5 "when" fields into a shell and have it work?

#2
cron doesn't run in your normal shell with all the $PATH stuff.
Use a full and complete path from / for every program and every file
in cron jobs.
/usr/local/bin/php /home/pruim/cronjob.php
Also change any code inside of cronjob.php to use a FULL PATH to
anything.
You can never go wrong specifying the full path, unless the path
itself is wrong.
You start making assumptions in your code about cwd and all hell
breaks loose, sooner or later.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux