数据库环境oracle 11g 64位 window server 2003
php环境:32位php,运行在windows xp上。
01.query('select * from test') as $row) {
07. print_r($row);
08. print(
);
09. }
10. $dbh = null;
11.} catch (pdoexception $e) {
12. print error!: . $e->getmessage() .
;
13. die();
14.}
15.?>
错误:
01.error!: sqlstate[hy000]: ocienvnlscreate: check the character set is valid and that php has access to oracle libraries and nls data (ext\pdo_oci\oci_driver.c:558)
如果修改成
01.query('select * from test') as $row) {
07. print_r($row);
08. print();
09. }
10. $dbh = null;
11.} catch (pdoexception $e) {
12. print error!: . $e->getmessage() .
;
13. die();
14.}
15.?>
则报错:
01.error!: sqlstate[]: pdo_oci_handle_factory: (ext\pdo_oci\oci_driver.c:579)
------解决方案--------------------
检查tnsnames.ora,listener.ora中,sqlnet.ora中,日志文件看看
------解决方案--------------------
前者是字符集名称错了
关键在于后者,你的 oci 版本是否低于 oracle 版本?
