PHP & cron: security issues

后端 未结 6 1291
孤城傲影
孤城傲影 2021-01-02 16:44

Whats the best way to ensure that only CRON executes PHP scripts, and not someone else who stumbled upon your php scripts..

I was thinking a Password Variable.... bu

6条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-02 17:00

    Suppose if u don't want anybody to run the file via http then set the cron by using php command as you are doing and add htacess to cron folder to block http request to the folder by adding

    deny from all to htacess

    Suppose if u want the cron folder to be password protected then it can be done as mentioned in the URl

    http://www.elated.com/articles/password-protecting-your-pages-with-htaccess/

提交回复
热议问题