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

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

        <bdo id='uNo54'></bdo><ul id='uNo54'></ul>
      <tfoot id='uNo54'></tfoot>
    1. <legend id='uNo54'><style id='uNo54'><dir id='uNo54'><q id='uNo54'></q></dir></style></legend>

      1. Cron 作业 $_SERVER 问题

        时间:2023-08-17
        • <bdo id='ReTcn'></bdo><ul id='ReTcn'></ul>
          <legend id='ReTcn'><style id='ReTcn'><dir id='ReTcn'><q id='ReTcn'></q></dir></style></legend>

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

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

                  本文介绍了Cron 作业 $_SERVER 问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想运行一个 cron 作业.我的应用程序是用 PHP 和 Mysql 开发的.

                  I want to run a cron job. My application is developed in PHP and Mysql.

                  在浏览器中,如果我在编码中使用 $_SERVER[HTTP_HOST],它工作正常.但是,如果我在 cron 作业中使用相同的东西,则会出错.

                  In browser if i use $_SERVER[HTTP_HOST] in coding, it works fine. But if I use the same thing in cron job it is giving errors.

                  任何机构都可以提出解决此问题的建议吗?

                  Can any body give suggestion to fix this?

                  推荐答案

                  $_SERVER['HTTP_HOST'] 从 cronjob 运行时未填充,文件未通过 HTTP 访问.

                  $_SERVER['HTTP_HOST'] is not populated when running it from a cronjob, the file is not accessed via HTTP.

                  您要么必须对主机进行硬编码,要么通过命令行参数传递它并通过 $_SERVER['argv'] 数组访问它.

                  You will either have to hardcode the Host or pass it via a command line argument and access it via the $_SERVER['argv'] array.

                  这篇关于Cron 作业 $_SERVER 问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何安装 cron 下一篇:在 Ubuntu 上为 php 执行 Cron 作业

                  相关文章

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

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