Mailing List Archive


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

Re: [tlug] Efficiently executing a cron job on my webhosting server



On 7/6/07, Dave Gutteridge <ebisudave@example.com> wrote:
TLUG,

I'm wondering two things.

One is, is this the most efficient way to call/execute the PHP script? I
always thought that accessing a local file via http was more inefficient
than accessing it through local directories. Maybe I'm wrong about that. Is
there a better way?

# you can install lynx if gcc is available there.

Local call is better than excuting wget IMO.

If you make test_cmd.php like:

#!/path/to/php

# insert your PHP code here

and put test_cmd.php in your contab -e, you will not have to call wget.

The second is, the first time I ran the above command in cron, I got an
error message (via my admin email) saying "permission denied". I changed the
permissions to 777 just to get it working. But what is the most appropriate
permission setting for a PHP script I'm intending to execute this way?
I don't know how your web server is configurated but

chmod o+r file.php

just works in most cases.

The reason is that file.php is owned by you, while when you wget it,
the web server run it under the owner of the web server.



--
Best Regards,
Nguyen Hung Vu
vuhung16plus{remove}@example.com
An inquisitive look at Harajuku
http://www.flickr.com/photos/vuhung/sets/72157600109218238/


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links