xxxxxxxxxx
etc/php/{your php version}/apache2/php.ini
etc/php/5.6/apache2/php.ini
xxxxxxxxxx
322
+250
The three files you have there are each meant for different uses.
/etc/php/5.6/cli/php.ini is for the CLI PHP program, which you found by running php on the terminal.
/etc/php/5.6/cgi/php.ini is for the php-cgi system which isn't specifically used in this setup.
/etc/php/5.6/apache2/php.ini is for the PHP plugin used by Apache. This is the one you need to edit for changes to be applied for your Apache setup which utilizes the in-built PHP module to Apache.
/etc/php/5.6/fpm/php.ini is for the php5-fpm processor, which is a fastcgi-compatible 'wrapper' for PHP processing (such as to hand off from NGINX to php5-fpm) and runs as a standalone process on the system (unlike the Apache PHP plugin)
xxxxxxxxxx
# Linux command to find php.ini
#7.4 is a version of php
cd /etc/php/7.4/apache2
# If you dont reach to the location which you are finding using the above
# Commnand there is an another way to do same
Step 1 : cd /var/www/html
Step 2 : touch phpinfo.php #this command is used to create a file named phpinfo.php
Step 3 : sudo nano phpinfo.php # this command will open a text editor
Step 4 : <?php phpinfo(); ?> # add this code and save the file
Step 5 : Open browser enter url http://127.0.0.1/phpinfo.php
#(Replce 127.0.0.1 with Your server public IP Address)
Step 6 : Here you'll see php page and search for (Loaded Configuration File)
: You'll see the path of php.ini in front of this line :)
# ThanksMeLater ;)