Where is my php.ini?


Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"


Top Level » Apache Related Information » Php

Where is my php.ini?Last Modified: Mar 15, 2018, 5:54 pm
A new and easy trick to find your php.ini would be to ask php itself what it's using, eg:

/usr/local/bin/php --ini | grep 'Loaded Configuration File'

which does assume that the php output will be in English.



If you're running the default version of CLI php, your php.ini will be located at:

/usr/local/lib/php.ini


If you're running php5 in CGI mode (suPhp), your php.ini will be located at:

/usr/local/etc/php5/cgi/php.ini


If you're running php4 in CGI mode (suPhp), your php.ini will be located at:

/usr/local/etc/php4/cgi/php.ini


If you're running php5.4 in php-FPM mode, your php.ini will be located at:

/usr/local/php54/lib/php.ini





CustomBuild 2.0 installs will also uses the php.conf.d directory to load miscellaneous .ini files into php.  The files that CustomBuild will create are:

/usr/local/lib/php.conf.d/10-directadmin.ini
/usr/local/lib/php.conf.d/50-webapps.ini

where the /usr/local can often be replaced with /usr/local/php54, depending on your setup.

You can add your own files there if you need to add settings or load modules into php.

© 2018 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST