PHP连接Informix异常

PHP装好pdo_informix扩展后连接informix数据提示异常:

#0 ...: PDO->__construct('informix:host=1...', 'user', 'passwd')
#1 ...: DbIfx->__construct()
#3 {main}
  thrown in ...

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE=HY000, SQLDriverConnect: -11005 [Informix][Informix ODBC Driver]Unspecified System Error =  -11005.'                                                     ed System Error =  -11005.' in /usr/share/nginx/html/hydee/db.ifx.php:31

  

 

 

 

解决方法: 输入以下环境变量:

export INFORMIXDIR=/opt/IBM/Informix_Client-SDK/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$INFORMIXDIR/lib:$INFORMIXDIR/lib/cli:$INFORMIXDIR/lib/esql

  

你可能感兴趣的:(PHP连接Informix异常)