Re: where php at?

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

 



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/php
 Warren:

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



--
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