<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 问题

        Cron Job $_SERVER issue(Cron 作业 $_SERVER 问题)
        • <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 问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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() 函数)

                  <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>
                        <tbody id='scSBW'></tbody>
                      <tfoot id='scSBW'></tfoot>