I just try to create a connection to a database using the Informix Driver.
The server is running on CentOS 6.4, with PDO_INFORMIX-1.3.1 and clientsdk.4.10.FC2DE.LINUX.
I set env var in /etc/sysconfig/httpd, and run this command :
When i run "php /var/www/html/informix.php" the connection is succesful, but when i call the same script on a browser, i get this error :
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE=08004, SQLDriverConnect: -908 [Informix][Informix ODBC Driver][Informix]Attempt to connect to database server (cms_net) failed.' in /var/www/html/informix.php:30 Stack trace: #0 /var/www/html/informix.php(30): PDO->__construct('informix:host=1...', 'user', 'xxxxx') #1 {main} thrown in /var/www/html/informix.php on line 30
I try to set a host in /etc/hosts, no success.
I don't know what to do to solve this problem. Anyone can help me ?
I solve the problem. Indeed, SELinux was the cause. I just do
setsebool -P httpd_can_network_connect=1