Skip to main content
Robert David
Today I accept that for some people, I may be too much or too little. But for the people who deserve me, I am just right.
Asked a question last year

how to find php ini?

Where am I?

In answerQA you can ask and answer questions and share your experience with others!

Angel Larry
I Don't like to Delete Old Messages, because they are My Memories!

In your terminal/console (only Linux, in windows you need Putty31)

ssh user@ip

php -i | grep "Loaded Configuration File"

It shows something like this Loaded Configuration

 File => /etc/php.ini.

ALTERNATIVE METHOD

You can make the php file on the website, which run: <?php phpinfo(); ?>, and you can see a php.ini location on your line with: "Loaded Configuration File".

Update This command gives path right away

cli_php_ini=php -i | grep /.+/php.ini -oE #ref. https: // intellipaat. com/a/15763333/248616

   php_ini="${cli_php_ini/cli/apache2}" #replace cli by apache2 ref. https :// intellipaat. com/a/13210909/248616