Question

There are many php.ini files inside our linux ubuntu server. I want to use ini_get in my php file; so how to tell the script to use the right php.ini file ?

Was it helpful?

Solution

You can check which php.ini file is the used one looking at the output of phpinfo().

See the image at this blog post, there's a row saying Loaded Configuration file. That's the value you are looking for.

From the command line, you can use:

php -i | grep 'Loaded Configuration File'

From inside php, there's the php_ini_loaded_file function

OTHER TIPS

please echo phpinfo()

You can find the path of the ini file in it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top