Problems with php configuration files under ubutun

install php and apache by apt-get under Ubuntu
see php.ini in the apahce2 directory in phpinfo

clipboard.png

1.
2.phpinfo,openssl

clipboard.png
phpinfo
clipboard.png

:php.ini

clipboard.png
the above three openssl extendsion are not opened, how can openssl take effect?

Aug.27,2021

The configuration file under

Ubuntu is more than one php.ini .

it will be enabled automatically when you install the php extension through apt . See if there is a conf.d directory in the same directory as php.ini . This directory also contains configuration files, which are included by default.

PHP extensions under

Ubuntu may not necessarily depend on php.ini, but may also be dependent, apt.


if you install php with apt, your configuration file should be / etc/php/PHP version number /

 apache2    // apache
 cgi        // cgi
 cli        // cli
 fpm        // fpm
 mods-available    // 

the order of references should be: first load the configuration of a sapi, and then all the configurations in the read mods-available.
sapi/php.ini > sapi/conf.d > mods-available this folder.
this is the default. So if it is the default module, please look under the mods-available folder. If not, find conf.d
sapi under sapi, which is the running mode of php.
I hope it can help you.

Menu