<bdo id='o50ea'></bdo><ul id='o50ea'></ul>

    <tfoot id='o50ea'></tfoot>

    1. <small id='o50ea'></small><noframes id='o50ea'>

      <legend id='o50ea'><style id='o50ea'><dir id='o50ea'><q id='o50ea'></q></dir></style></legend>
      <i id='o50ea'><tr id='o50ea'><dt id='o50ea'><q id='o50ea'><span id='o50ea'><b id='o50ea'><form id='o50ea'><ins id='o50ea'></ins><ul id='o50ea'></ul><sub id='o50ea'></sub></form><legend id='o50ea'></legend><bdo id='o50ea'><pre id='o50ea'><center id='o50ea'></center></pre></bdo></b><th id='o50ea'></th></span></q></dt></tr></i><div id='o50ea'><tfoot id='o50ea'></tfoot><dl id='o50ea'><fieldset id='o50ea'></fieldset></dl></div>
    2. 通过 crontab 一个变量并从 PHP 读取它?

      pass crontab a variable and read it from PHP?(通过 crontab 一个变量并从 PHP 读取它?)

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

            <legend id='oGheF'><style id='oGheF'><dir id='oGheF'><q id='oGheF'></q></dir></style></legend>
              <tbody id='oGheF'></tbody>
              • 本文介绍了通过 crontab 一个变量并从 PHP 读取它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我创建了一个 crontab 规则:

                I have created a crontab rule:

                * * * * * php/my/directory/file.php

                我想从这个 crontab 传递一个要在 file.php 中使用的变量.

                I want to pass a variable to be used in the file.php from this crontab.

                这样做的最佳方法是什么?

                What is the best method to do this?

                推荐答案

                请记住,在 shell 中运行 PHP 与在 Web 服务器环境中运行完全不同.如果你之前没有做过命令行编程,你可能会遇到一些惊喜.

                Bear in mind that running PHP from the shell is completely different from running it in a web server environment. If you haven't done command-line programming before, you may run into some surprises.

                也就是说,将信息传递到命令中的常用方法是将其放在命令行中.如果你这样做:

                That said, the usual way to pass information into a command is by putting it on the command line. If you do this:

                 php /my/directory/file.php "some value" "some other value"
                

                然后在你的脚本中,$argv[1] 将被设置为 "some value"$argv[2] 将被设置为设置为 其他值".($argv[0] 将被设置为 "/my/directory/file.php").

                Then inside your script, $argv[1] will be set to "some value" and $argv[2] will be set to "some other value". ($argv[0] will be set to "/my/directory/file.php").

                这篇关于通过 crontab 一个变量并从 PHP 读取它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                    <tbody id='RRocM'></tbody>
                  • <bdo id='RRocM'></bdo><ul id='RRocM'></ul>

                      <legend id='RRocM'><style id='RRocM'><dir id='RRocM'><q id='RRocM'></q></dir></style></legend>

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

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