Run a script.php on cron job on linux/apache server but restrict public access to the php file

前端 未结 4 1549
再見小時候
再見小時候 2020-12-19 08:26

I have this script.php file which i want to run as a cron job on my linux/apache server.

However, i do not want public to access www.mycompanyname.com/script.php and

4条回答
  •  一个人的身影
    2020-12-19 08:51

    If you put the script outside of the webroot folder it will not be accessible through your webserver. e.g. your webroot is at /var/www/public_html/ you put the script.php outside of that folder, for example: /var/www/

提交回复
热议问题