Forum Moderators: bakedjake
/usr/home/webXXX/www/htdocs/test2.php
: not found
(where webXXX is my root)
I tried using
/usr/home/webXXX/www/htdocs/test2.php as well as
~/www/htdocs/test2.php
in the crontab file, with the same result.
test2.php is definitely in my htdocs.
Any ideas?
Thanks
is the true path from the server root? If the cron can't find it then it is something in the path I would guess.
I usually run my crons in a browser while testing and then move them above the root to their true home (in my system) once I know they work properly. I can then echo testing data (such as paths ;) ) to the browser for ease of debugging.
1) edit the php script and add "#!/usr/local/bin/php" (no quotes) to the FIRST line of the file. That will tell your shell what interpreter to open, so basically bash runs "/usr/local/bin/php /the/script/youre/running.php"
2) in your cron, actually specify where your PHP binary is. Usually in /usr/local/bin. If it's not there, and you're not sure where it is, type: "whereis php" or "locate php". Then, in your crontab, add a line like:
"0 0 * * * /usr/local/bin/php /path/to/your/php/file.php"
This tells the PHP CLI to parse your script.
PS: If you still don't see the php binary, it may be that you need to install the CLI packages.
HTH
MM
that's your problem - you dont have the php-cli installed.
what distro are you using?
In Debian you can install it by doing
apt-get php-cli
to test it , drop to a console and type (as root)
php -v
You should then get something like this:
# php -v
PHP 4.3.8 (cli) (built: Jul 30 2004 13:00:16)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with DBG v2.11.23, (C) 2000,2001,2002,2003, by Dmitri Dmitrienko