Shell run/execute php script with parameters

前端 未结 5 1776
独厮守ぢ
独厮守ぢ 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

    test.php:

    
    

    Shell:

    $ php -q test.php foo bar
    Array
    (
        [0] => test.php
        [1] => foo
        [2] => bar
    )
    

提交回复
热议问题