Good day everybody, I am in desperate need for help trying to sort this out.
At work I was asked to install PHP and Informix on a CentOS 6 machine so they can begin developing some web projects. I've been working on it for almost a week now, but I still can't get the PDO working. I followed 3 guides already, two of which are the following:
http://www.whitemiceconsulting.com/2012/02/installing-pdoinformix-on-centos6.html
http://lemachete.wordpress.com/2009/06/26/instalar-pdo_informix-en-linux-centos/ [in spanish]
and the third one was written by a person that used to work with us and was provided by a co-worker so I can't post it here (company's property). I followed each guide to the letter, and even combined the guides trying to get informix running, but to no avail. I already formatted the machine 3 times so I can start over. So far, this is what I managed to do:
The environment variable INFORMIXDIR is set to /opt/IBM/informix (the same directory where I installed informix)
Both the pdo.so and pdo_informix.so were created in /usr/lib/php/modules
The following lines were added in /etc/php.ini: extension=pdo.so and extension=pdo_informix.so
I have a user called informix
Just in case, I also added the following line to the pdo.ini file in /etc/php.d: extension=pdo_informix.so
I also modified some other files like the /etc/init.d/httpd and the /etc/profile but as far as I know, just doing the above should be enough to get the Informix PDO up and running.
However, if I try to run this program:
<?php
echo '<h3>Available PDOs:</h3>';
foreach (PDO::getAvailableDrivers() as $driver)
{
echo $driver . '<br/>';
}
?>
All I get as a result is:
Available PDOs:
sqlite
Checking the phpinfo() confirms that only the SQLite PDO is loaded. Also if I try to access the server using $db = new PDO(); sentence, I get this error:
[Thu Sep 26 11:36:21 2013] [error] [client 127.0.0.1] PHP Fatal error: Uncaught exception 'PDOException' with message 'invalid data source name' in /var/www/html/informixTest.php:22\nStack trace:\n#0 /var/www/html/informixTest.php(22): PDO->__construct('informix=148.23...', 'informix', '1nf0rm1x123')\n#1 {main}\n thrown in /var/www/html/informixTest.php on line 22
I already tried everything I've found on the web, but nothing works. Can somebody please help me sort this out? What am I doing wrong?
PS: just in case anybody wonders, I did restart apache after applying any modification to the PHP configuration. I also checked if there is another php.ini file that is overriding the one I modified, but there is none.