Contents

PHP -q 是什麼指令

Contents

最近看到公司舊的排程有這個指令
php -h 沒有看到
後來官網看到被廢棄掉

稍微研究了一下
好像跟以前執行程式有關係

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
 $ php-cgi p.php

    X-Powered-By: PHP/5.5.18
    Content-type: text/html
    hello world

You can suppress these headers:
$ php-cgi -q p.php
    hello world
The php executable in recent versions of PHP doesn't need this. Using -q or not using -q gives the same result:
    $ php -q p.php
hello world
$ php p.php
hello world

參考來源:
What does ‘PHP -q’ do as opposed to ‘PHP’ when executing a PHP script from command line? - Quora

排程
用于监控 cron 作业和自动化任务的系统? - VoidCC