Page 1 of 1
cron and php
Posted: Thu May 20, 2004 9:30 pm
by nikko50
Hello there. I can't seem to get this crontab to run my cron.php page which is is a simple db query. Here is the code for the crontab entry
27 * * * * /homepages/29/test/htdocs/cron.php >/dev/null
Does this look good to you. Any suggestions???
Posted: Thu May 20, 2004 9:35 pm
by launchcode
You should be passing it through php first (or using a CGI version of PHP in your script).
It's location will vary depending on your server. But pass the "php.exe" (on Windows) your path + file.
Posted: Thu May 20, 2004 9:51 pm
by nikko50
Thanks for the reply. Can I find my web server PHP executable location with phpinfo()?? Also can I find my root dir with phpinfo()??
Tracy:)
Posted: Thu May 20, 2004 10:00 pm
by launchcode
Root DIR yes definitely - php exe location I'm afraid not, sorry. Do you have telnet/ssh access to your server?
Posted: Thu May 20, 2004 10:03 pm
by nikko50
Hi Rich. Yes I do. I'm in there right now.
Tracy
Posted: Thu May 20, 2004 10:06 pm
by launchcode
If it is a Unix server try this:
where php
for me it is in: /usr/local/bin/php
You can pass your PHP scrript directly to that.
Posted: Thu May 20, 2004 10:10 pm
by nikko50
tried that and get bad command.
Tracy:(
Posted: Thu May 20, 2004 10:13 pm
by launchcode
Is it a Unix server? If so you could try "locate php" too - or just see if the following work:
/usr/local/bin/php
/usr/bin/php
Remember you must pass it the full path to your script (once you locate it!)
Posted: Thu May 20, 2004 10:40 pm
by nikko50
Works great now. Hugs for you!!
Cheers,
Tracy