phplinuxphp-ini

Where can I find php.ini?


Today I needed to install the IBM DB2 library. I went through all the steps up to make install, and I found ibm_db2.so in $PHP_HOME/lib/extensions/somecomplicatedname/ibm_db2.so.

The great catch is the last step is to configure file php.ini, but there aren't any php.ini files on my system. PHP works fine, except of course for this newfangled ibm_db2 thingamajig. (I tried a small PHP script which fails and indicates that the ibm_db2 functions are not available.)

How would I go about finding or setting up the php.ini file so that I can enable the library I need?


Solution

  • according to this answer, as of PHP 7 the regular php.ini file was removed and added with php.ini-production and php.ini-devlopment.

    so instead of php.ini which does not exist in my case (I've installed php 8.1), use php.ini-production and it's located in php installation folder (something like: C:\PHP-8.1.5) and create a file and name it php.ini and then copy contents of php.ini-production in this new php.ini.