A few years ago I installed Apache 2.2x and PHP 5.3.1 on a Linux server I maintain. I used .tar.gz's and built them as instructed (instead of rpms and what-have-you). And all was fine.
Today I need to install this which seems like a PHP library. I went through all the steps up to make install, and I find ibm_db2.so in $PHP_HOME/lib/extensions/somecomplicatedname/ibm_db2.so
The great catch is the last step is to configure php.ini but there is NO php.ini on my system. Horror of horrors. PHP works fine, except of course for this new-fangled ibm_db2 thingamagic that I want to use so somebody can use a GUI to tinker with DB2
. (I tried a small php script which fails and indicates that the ibm_db2 functions are not available).
I have to deal with PHP once every few years, so please enlighten me at a very basic level about what I could do to enable web-based GUI access to DB2
.
You can get more info about your config files using something like:
Hey... it worked for me!
On the command line execute:
You will get something like:
That's from my local dev-machine. However, the second line is the interesting one. If there is nothing mentioned, have a look at the first one. That is the path, where PHP looks for the
php.ini
.You can grep the same information using
phpinfo()
in a script and call it with a browser. Its mentioned in the first block of the output.php -i
does the same for the command line, but its quite uncomfortable.Best way to find this is: create a php file and add the following code:
and open it in browser, it will show the file which is actually being read!
Updates by OP:
<?php echo php_ini_loaded_file(); ?>
mentioned in this answer.Use the following commands to find the
php.ini
file path in linux.or try this another way
[root@AnyDirectory ~]# php --ini
its shows the path result
For SAPI: php-fpm
There is no need to create a php.info file (it is not a good policy to leave it for the world to read anyway). On the command line:
Somewhere in its output, it will show this line:
Here is a more complete explanation: https://www.cloudinsidr.com/content/how-to-figure-out-your-php-configuration-parameters-without-info-php/