Skip to main content
Jaxon Axel
"Knowing other is Intelligence. Knowing yourself is wisdom. Mastering other is strength. Mastering our self is absolute power."
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!

Asher Bill
You do not have to go fast, you just have to keep going

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

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