php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42563 OCI Oracle Connect error: OCINlsCharSetNameToId
Submitted: 2007-09-05 12:38 UTC Modified: 2016-03-08 01:34 UTC
From: t_wiedmann at t-online dot de Assigned:
Status: Not a bug Package: PDO OCI
PHP Version: 5.2.4 OS: Win XP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: t_wiedmann at t-online dot de
New email:
PHP Version: OS:

 

 [2007-09-05 12:38 UTC] t_wiedmann at t-online dot de
Description:
------------
Hi,

if I try to connect to Oracle DB I get this error since PHP 5.2.4, with 5.2.0 or 5.2.1 work well

Regards,
Thomas

Reproduce code:
---------------
<?php

 /**
 * php.ini  (v5.2.4)
 *
 * ; Windows Extensions
 * extension=php_pdo.dll
 * extension=php_pdo_oci.dll
 * 
 */
 define('DBUSER','user');
 define('DBPASS','password');
 define('DBNAME','database');  

 try {
 
  // Connect to Oracle Windows v9.2 or v10
  $dbh = new PDO('oci:dbname='.DBNAME.';charset=ISO-8859-1',DBUSER,DBPASS);  
  echo 'Connect ok';
  
  $dbh = null;
  
 } catch (PDOException $e) {
 
  // Connect failed: SQLSTATE[HY000]: OCINlsCharSetNameToId: unknown character set name (ext\pdo_oci\oci_driver.c:488)
  echo 'Connect failed: ';  
  echo $e->getMessage();
  die();
 }

?>

Expected result:
----------------
Connect ok


Actual result:
--------------
Connect failed: SQLSTATE[HY000]: OCINlsCharSetNameToId: unknown character set name (ext\pdo_oci\oci_driver.c:488)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-06 08:01 UTC] t_wiedmann at t-online dot de
In the meantime, I have moved to PHP v5.2.3. This Version work well. 

Regards
Thomas
 [2007-09-08 22:23 UTC] sixd@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

----------
Use an Oracle character set name.  The value you are passing is ignored prior to PHP 5.2.4 because it is invalid.

A list of character sets is in the Oracle documentation: http://download.oracle.com/docs/cd/B19306_01/server.102/b14225/applocaledata.htm#sthref1958
----------
 [2016-03-08 01:34 UTC] sixd@php.net
-Package: PDO related +Package: PDO OCI
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC