PHP Command Line php.ini path error

前端 未结 2 1161
萌比男神i
萌比男神i 2020-12-19 11:44

I am trying to run some PHP pages on the command line but am running into a few problems with mysql and other PHP extensions.

Running php --ini produce

2条回答
  •  忘掉有多难
    2020-12-19 12:33

    Using the -c option, you can specify which php.ini file should be used :

    php -c /etc/php.ini your-php-script.php
    


    As a reference, see the output of php --help :

    $ php --help
    Usage: php [options] [-f]  [--] [args...]
           php [options] -r  [--] [args...]
           php [options] [-B ] -R  [-E ] [--] [args...]
           php [options] [-B ] -F  [-E ] [--] [args...]
           php [options] -- [args...]
           php [options] -a
    
      -a               Run as interactive shell
      -c | Look for php.ini file in this directory
      -n               No php.ini file will be used
      -d foo[=bar]     Define INI entry foo with value 'bar'
      ...
    

提交回复
热议问题