Linux PHP Servers

Where is the php.ini configuration and enabled PHP modules? – Ubuntu Server

PHP configuration folders is usually in /etc/php/ and the installed version, in my case is in /etc/php/7.4/

The active version can be found with the following command in Ubuntu (ubuntu 20.04 for my case):

@ php -version

PHP 7.4.13 (cli) (built: Dec 10 2020 08:08:23) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.13, Copyright (c), by Zend Technologies
@ php -a
Interactive mode enabled

php > phpinfo();
PHP Version => 7.4.13

System => Linux *** 5.4.0-1009-kvm #9-Ubuntu SMP Mon Apr 20 20:23:86 UTC 2020 x86_64
Build Date => Dec 10 2020 08:08:23
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /etc/php/7.4/cli
Loaded Configuration File => /etc/php/7.4/cli/php.ini
Scan this dir for additional .ini files => /etc/php/7.4/cli/conf.d
Additional .ini files parsed => /etc/php/7.4/cli/conf.d/10-mysqlnd.ini,

From the results we deduce that the current active configuration for the installed php is in the folder /etc/php/7.4/ .

So the modules are in the /etc/php/7.4/mods-available/ folder and for php-fpm, the configuration files (php.ini) are in /etc/php/7.4/fpm/*


Happy Coding!

One reply on “Where is the php.ini configuration and enabled PHP modules? – Ubuntu Server”

Leave a Reply

Your email address will not be published. Required fields are marked *