php-info-ini-config-path-ubuntu-server_cr

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();
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,
/etc/php/7.4/cli/conf.d/10-opcache.ini,
/etc/php/7.4/cli/conf.d/10-pdo.ini,
/etc/php/7.4/cli/conf.d/15-xml.ini,
/etc/php/7.4/cli/conf.d/20-apcu.ini,
/etc/php/7.4/cli/conf.d/20-bcmath.ini,
/etc/php/7.4/cli/conf.d/20-bz2.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/*

php-info-ini-config-path-ubuntu-server

Happy Coding!

Tags: , , , ,

One Comment

  1. […] 1). Locate the folder where php is installed […]

Leave a Reply

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