问题描述
我有这个 script.php 文件,我想在我的 linux/apache 服务器上将其作为 cron 作业运行.
I have this script.php file which i want to run as a cron job on my linux/apache server.
但是,我不希望公众访问 www.mycompanyname.com/script.php 并同时运行脚本.
However, i do not want public to access www.mycompanyname.com/script.php and also run the script concurrently.
我们如何防止这种情况发生?我们如何限制脚本只能访问服务器?是使用 chmod 还是在 .htaccess 文件中设置了一些东西?
How can we prevent that? How can we restrict the script to the server's access only? Is it using chmod or setting something inside .htaccess file, something along the line?
有什么建议吗?
推荐答案
您可能有一个类似于 public_html 的目录,其中包含所有 php.把它放在那个目录之外.
You probably have something like a public_html directory, in which you have all the phps. Just put it outside of that directory.
这篇关于在 linux/apache 服务器上的 cron 作业上运行 script.php,但限制对 php 文件的公共访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!



大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)