[Techtalk] A PHP script in a crontab.
Sue Stones
suzo at spin.net.au
Sat Jan 29 16:57:28 EST 2005
Devdas Bhagat wrote:
>>"GET http://www.hostyorkshire.com/scgi-bin/script.php > /dev/null "
>>
>>I am not sure what the GET does! This doesn't work.
>
>
> If you don't have GET, but you do have access to wget,
> wget http://www.hostyorkshire.com/scgi-bin/script.php -O - > /dev/null
Well the webhoster says that GET is there so I presume it is, its just
that it doesn't work. I don't have access to the shell, so I can only
take their word for it!
> Alternatively, you can call the PHP interpreter directly
> /usr/bin/php /local/path/to/php/script.php > /dev/null
> PHP code is not executed in a web browser. PHP code is executed on the
> web server, in response to a request. The server really doesn't care
> what application made the request.
So what is the difference between this and the cli? Does the cli needs
to be installed?
> (Or you could set MAILTO= in the crontab to achieve the same as
> command > /dev/null2>&1 for all commands in your crontab.
I don't understand this "MAILTO=" bit.
"command > /dev/null" doesn't work.
None of the following work:
script.php
/home/username/public_html/scgi-bin/script.php > /dev/null
http://url/scgi-bin/script.php > /dev/null
GET /home/username/public_html/scgi-bin/script.php > /dev/null
GET http://url/scgi-bin/script.php > /dev/null ***
GET script.php
php /home/username/public_html/scgi-bin/script.php > /dev/null
php http://url/scgi-bin/script.php
php script.php
*** the one the webhoster told me to use
Anyone got any other ideas?
If it comes to the worst, I will have to rewrite this in pearl. But I
really don't want to, because I am tiered and I want a break from this
project, I am over the deadline, and I don't know perl.
sue
More information about the Techtalk
mailing list