2013-11-22 15:24
浏览 94

PDO Informix ODBC驱动程序可与PHP CLI配合使用,但不适用于浏览器

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 :

  • chcon -t lib_t /opt/informix/lib/cli/*.so
  • chcon -t lib_t /opt/informix/lib/*.so
  • chcon -t lib_t/opt/informix/lib/esql/*.so
  • chcon -t lib_t /opt/informix/lib/c++/*.so
  • chcon -t lib_t /opt/informix/lib/dim/*.so
  • chcon -t lib_t /opt/informix/lib/client/cms/*.so
  • chcon -t lib_t /opt/informix/OAT/Apache_2.4.2/modules/*.so
  • chcon -t lib_t /opt/informix/OAT/PHP_5.4.4/*.so
  • chcon -t lib_t /opt/informix/OAT/PHP_5.4.4/lib/php/extensions/*.so
  • /sbin/ldconfig
  • setenforce 0

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 ?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题