Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] Permissions on PHP script to only run locally
- Date: Tue, 9 Mar 2010 08:29:07 +0000
- From: Godwin Stewart <gstewart@example.com>
- Subject: Re: [tlug] Permissions on PHP script to only run locally
- References: <4B95BD95.4020201@example.com>
On Tue, 09 Mar 2010 12:16:37 +0900, Dave M G <dave@example.com> wrote: > I wondered if there was a permission setting I could put on the file so > that it was only accessible by the server's local cron command, and not > accessible by anyone coming at it from the browser. Trying to play with permissions is probably the wrong way to go about it here. I take it this script is run by the CLI version of PHP invoked by cron, right? If so, have the script detect whether it is run by apache or by cron. Detect, for example, a variable that's only present in the web-based variant and kill the script if it is found. For example, if ( isset($_SERVER['REMOTE_ADDR']) ) exit(0); -- G. Stewart - gstewart@example.com Real programmers don't write in FORTRAN. FORTRAN is for pipe stress freaks and crystallography weenies. FORTRAN is for wimp engineers who wear white socks.Attachment: pgpvA8mRKnCGm.pgp
Description: PGP signature
- Follow-Ups:
- Re: [tlug] Permissions on PHP script to only run locally
- From: Curt Sampson
- References:
- [tlug] Permissions on PHP script to only run locally
- From: Dave M G
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Permissions on PHP script to only run locally
- Next by Date: Re: [tlug] Permissions on PHP script to only run locally
- Previous by thread: Re: [tlug] Permissions on PHP script to only run locally
- Next by thread: Re: [tlug] Permissions on PHP script to only run locally
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links