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.
To get the php. ini file which is being used by Apache you will probably have to add phpinfo() into a . php file and open it in the browser. As php -r "phpinfo();" | grep php.
The default location for the php. ini file is: Ubuntu 16.04: /etc/php/7.0/apache2. CentOS 7: /etc/php.
php -i | grep 'my_value'
or
php -r "echo ini_get('my_value');"
or
grep 'my_value' /path/to/php.ini
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With