: Safe directory for cron job PHP scripts I have a website which I run a PHP script for updating its Database. What is considered to be an acceptable location on the server to store such scripts?
I have a website which I run a PHP script for updating its Database.
What is considered to be an acceptable location on the server to store such scripts? Obviously only the root (running a cronjob to start the script) should have access to it.
Thanks,
Joel
More posts by @Chiappetta492
1 Comments
Sorted by latest first Latest Oldest Best
If you are worried about access to this script you can add a random string to the command line argument of the cron job string e.g.
php /path/to/script.php random_string
Then in your script.php you check argv0 to see if that string is exists and is correct before running the rest of your code.
Another way is to put the cron script in a folder and restrict its access using a .htaccess file. Here is an answer on how to do this: serverfault.com/questions/92192/apache-htaccess-file-to-restrict-access-to-all-files-unless-local-ip
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.