How to enable/disable PHP extension for PHP CLI if there is no loaded configuration file?

5,058

php -i also shows the location where it expects the configuration file to be, just run php -i |grep -i configuration.

Example output from my Ubuntu host:

$ php -i |grep -i configuration
Configuration File (php.ini) Path => /etc/php/7.2/cli
Loaded Configuration File => /etc/php/7.2/cli/php.ini

Just copy a php.ini file there and adapt it to your needs (or just create a symlink).

Share:
5,058
Black
Author by

Black

Full-Stack Webdeveloper, Magento & more.

Updated on September 18, 2022

Comments

  • Black
    Black over 1 year

    I just executed php -i | grep "Loaded Configuration File" to find out where the configuration file of my PHP CLI is stored, but I get: Loaded Configuration File => (none). So it loads the default settings as a fallback.

    How can I enable the openssl extension for PHP CLI if no configuration file is loaded?

    Currently I get OpenSSL support => disabled (install ext/openssl) when calling php -i | grep -i "openssl"