Shell run/execute php script with parameters

前端 未结 5 1765
独厮守ぢ
独厮守ぢ 2020-12-02 22:59

I need to execute a php file with parameters through shell.

here is how I would run the php file:

php -q htdocs/file.php

5条回答
  •  温柔的废话
    2020-12-02 23:23

    You need to read command line parameters from $argc and $argv.

    Using a question mark is something you do in a URL and has nothing to do with executing PHP from a command line.

    See also: http://www.sitepoint.com/php-command-line-1/

提交回复
热议问题