Marty Wallace
Marty Wallace

Reputation: 35734

Get an ini setting in PHP at the command line

On the Linux command line, is it possible to run a command to get a PHP ini settings value?

I understand that I can echo phpinfo() or simply go and inspect the .ini file, but I can’t see a command to run that will display the value directly on the command line.

Upvotes: 44

Views: 38312

Answers (1)

Sammitch
Sammitch

Reputation: 32232

php -i | grep 'my_value'

or

php -r "echo ini_get('my_value');"

or

grep 'my_value' /path/to/php.ini

Upvotes: 74

Related Questions