php cli 參數

來源:互聯網
上載者:User
發現指令碼中 /user/bin/php -qd open_dir=/

查手冊,d define,用該參數可以自行設定任何可以在 php.ini 檔案中設定的配置選項的值,其文法為:

-d configuration_directive[=value] # 取值部分被省略,將會把配置選項設為 "1"
$ php -d max_execution_time -r '$foo = ini_get("max_execution_time"); var_dump($foo);' string(1) "1"
# 取值部分為空白,將會把配置選項設為 ""
php -d max_execution_time= -r '$foo = ini_get("max_execution_time"); var_dump($foo);' string(0) ""
# 配置選項將被設定成為任何 '=' 字元之後的值 $ php -d max_execution_time=20 -r '$foo = ini_get("max_execution_time"); var_dump($foo);' string(2) "20"
$ php -d max_execution_time=doesntmakesense -r '$foo = ini_get("max_execution_time"); var_dump($foo);' string(15) "doesntmakesense

但是,q 參數沒有,網上資料也找不到,查源碼:

{'q', 0, "no-header"}, /* for compatibility with CGI (do not generate HTTP headers) */

不產生HTTP headers, 由於時間關係沒有實際測試。

做筆記。

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.