Re: where php at?
| From: | Warren Vail | Date: | Mon, 27 Mar 2006 21:10:40 +0000 |
| Subject: | Re: where php at? | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-232670@lists.php.net to get a copy of this message | ||
I believe the command portion of your chron entry is "/usr/local/bin/php /full/path/to/myscript.php" (separated by a space)
My Cpanel allows two methods scheduling (updating cron.tab file), if you are using the unix option, you have the ability to schedule the execution at a certain time of day, etc. Soneone else on this thread gave you a pretty good description of how that works, and there are other tutorials out there that will help. I prefer the unix option from my cpanel.
make sure that the full path name is provided to your script, usually this will point to home/user or something like that. Also your script will need to use full path names to files, you can use the "pwd" command (as we did with which) to find out what the current directory is for your script, but it is safest to use nothing but full directory names, because it is almost guaranteed to not be what you would expect, so relative path names will give you problems.
hope this helps,
Warren Vail
At 11:59 AM 3/27/2006, tedd wrote:
try creating a file called "which.php" have it contain the following; <?php $result = exec("which php"); echo $result; ?> Upload it to your website and execute it in your browser. I uploaded it to my RedHat Linux server and it showed the following; /usr/local/bin/phpWarren: Bingo -- that did it -- mine is: /usr/local/bin/php as well. Now, to figure out what command I need to run a php script from there. Thanks -- one step closer. tedd -- -------------------------------------------------------------------------------- http://sperling.com