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 13:34:44 +0900
- From: Nicolas Limare <nicolas+tlug@example.com>
- Subject: Re: [tlug] Permissions on PHP script to only run locally
- References: <4B95BD95.4020201@example.com>
- User-agent: Mutt/1.5.18 (2008-05-17)
Dave, > I have a PHP script that runs a backup of some site files and emails me > a tar.gz file once a day. It's activated by cron on the webhosting server > > 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. The best solution is to put this php script out of the web server DocumentRoot (Apache terminology). For example, if your web server distributes files located in the /var/www/example.com/ directory, and your bachup script is now located at /var/www/example.com/foo/backup.php, you should remove this file and save if in /home/dave/scripts/backup.php for example. There, no one can execute this script through the web server. But you can still run it with a cron line # m h dom mon dow command 6 42 * * * /usr/bin/php /home/dave/scripts/backup.php -- Nicolas LIMARE smtp:nicolas@example.com pgp:0xFA423F4F xmpp:nicolas@example.com http://nicolas.limare.netAttachment: signature.asc
Description: Digital signature
- 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