<bdo id='S5r1M'></bdo><ul id='S5r1M'></ul>
      <tfoot id='S5r1M'></tfoot>
      <i id='S5r1M'><tr id='S5r1M'><dt id='S5r1M'><q id='S5r1M'><span id='S5r1M'><b id='S5r1M'><form id='S5r1M'><ins id='S5r1M'></ins><ul id='S5r1M'></ul><sub id='S5r1M'></sub></form><legend id='S5r1M'></legend><bdo id='S5r1M'><pre id='S5r1M'><center id='S5r1M'></center></pre></bdo></b><th id='S5r1M'></th></span></q></dt></tr></i><div id='S5r1M'><tfoot id='S5r1M'></tfoot><dl id='S5r1M'><fieldset id='S5r1M'></fieldset></dl></div>

      <small id='S5r1M'></small><noframes id='S5r1M'>

        <legend id='S5r1M'><style id='S5r1M'><dir id='S5r1M'><q id='S5r1M'></q></dir></style></legend>
      1. 在 linux/apache 服务器上的 cron 作业上运行 script.php,但限制对 php 文件的公共访问

        Run a script.php on cron job on linux/apache server but restrict public access to the php file(在 linux/apache 服务器上的 cron 作业上运行 script.php,但限制对 php 文件的公共访问)

        <small id='noluL'></small><noframes id='noluL'>

        1. <legend id='noluL'><style id='noluL'><dir id='noluL'><q id='noluL'></q></dir></style></legend>
          • <i id='noluL'><tr id='noluL'><dt id='noluL'><q id='noluL'><span id='noluL'><b id='noluL'><form id='noluL'><ins id='noluL'></ins><ul id='noluL'></ul><sub id='noluL'></sub></form><legend id='noluL'></legend><bdo id='noluL'><pre id='noluL'><center id='noluL'></center></pre></bdo></b><th id='noluL'></th></span></q></dt></tr></i><div id='noluL'><tfoot id='noluL'></tfoot><dl id='noluL'><fieldset id='noluL'></fieldset></dl></div>
                <bdo id='noluL'></bdo><ul id='noluL'></ul>

                    <tbody id='noluL'></tbody>

                  <tfoot id='noluL'></tfoot>
                  本文介绍了在 linux/apache 服务器上的 cron 作业上运行 script.php,但限制对 php 文件的公共访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有这个 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 文件的公共访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Is PHP or PHP based web framework stateful or stateless?(PHP 或基于 PHP 的 Web 框架是有状态的还是无状态的?)
                  How to parse django style template tags(如何解析 django 样式模板标签)
                  What is a good setup for editing PHP in Emacs?(在 Emacs 中编辑 PHP 的好设置是什么?)
                  How to check whether specified PID is currently running without invoking ps from PHP?(如何在不从 PHP 调用 ps 的情况下检查指定的 PID 当前是否正在运行?)
                  What#39;s the difference between escapeshellarg and escapeshellcmd?(escapeshellarg 和escapeshellcmd 有什么区别?)
                  php in background exec() function(php 后台 exec() 函数)
                1. <small id='Rc9ve'></small><noframes id='Rc9ve'>

                      <bdo id='Rc9ve'></bdo><ul id='Rc9ve'></ul>
                    • <legend id='Rc9ve'><style id='Rc9ve'><dir id='Rc9ve'><q id='Rc9ve'></q></dir></style></legend>
                          <tbody id='Rc9ve'></tbody>

                            <tfoot id='Rc9ve'></tfoot>
                            <i id='Rc9ve'><tr id='Rc9ve'><dt id='Rc9ve'><q id='Rc9ve'><span id='Rc9ve'><b id='Rc9ve'><form id='Rc9ve'><ins id='Rc9ve'></ins><ul id='Rc9ve'></ul><sub id='Rc9ve'></sub></form><legend id='Rc9ve'></legend><bdo id='Rc9ve'><pre id='Rc9ve'><center id='Rc9ve'></center></pre></bdo></b><th id='Rc9ve'></th></span></q></dt></tr></i><div id='Rc9ve'><tfoot id='Rc9ve'></tfoot><dl id='Rc9ve'><fieldset id='Rc9ve'></fieldset></dl></div>