Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Linux by (18.4k points)
I can't find PHP.ini location on the server. I have checked on intellipaat but I can't find my php.ini location.

I am using Linux, Cent OS, zPanel. Last version of PHP.

My computer: Linux Mint 15 KDE.

1 Answer

0 votes
by (36.8k points)
edited by

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

Come and join Linux training to gain great knowledge. 

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...