- 论坛徽章:
- 0
|
本帖最后由 onunix 于 2012-07-02 10:47 编辑
数据库环境 racle 11g 64位 window server 2003
PHP环境:32位php,运行在windows XP上。- <?php
- try {
-
- $dbh = new PDO('oci:dbname=//172.30.1.39:1521/orcl;charset=utf8', 'scott','neusoft');
- foreach($dbh->query('SELECT * from test') as $row) {
- print_r($row);
- print("<hr>");
- }
- $dbh = null;
- } catch (PDOException $e) {
- print "Error!: " . $e->getMessage() . "<br/>";
- die();
- }
- ?>
复制代码 报的错误:- 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)
复制代码 如果修改成- <?php
- try {
-
- $dbh = new PDO('oci:dbname=//172.30.1.39:1521/orcl', 'scott','neusoft');
- foreach($dbh->query('SELECT * from test') as $row) {
- print_r($row);
- print("<hr>");
- }
- $dbh = null;
- } catch (PDOException $e) {
- print "Error!: " . $e->getMessage() . "<br/>";
- die();
- }
- ?>
复制代码 则报错:- Error!: SQLSTATE[]: pdo_oci_handle_factory: <> (ext\pdo_oci\oci_driver.c:579)
复制代码 |
|