Perl mit Oracle unter Windows
Für ein Webentwicklungsprojekt habe ich lokal den IIS und eine Oracle Datenbank (9i) laufen. Normalerweise ist diese Anwendung unter PHP entwickelt worden, einige Teile müssen jedoch in Perl programmiert werden.
Dazu installierte ich zunächst ActivePerl Paket von ActiveState und installierte danach über den Perl Packet Manager ppm das Paket Oracle.pm.
Von nun an funktionierte aber weder ein Datenbankzugriff über Perl, noch über PHP mehr reibungslos. Folgender Fehler trat auf:
Warning: ociplogon(): OCISessionBegin: ORA-12705: Cannot access NLS data files or invalid environment specified
in c:inetpubwwwrootutils.inc on line 13Warning: ociplogon(): OCISessionBegin: ORA-12705: Cannot access NLS data files or invalid environment specified
in c:inetpubwwwrootutils.inc on line 13Warning: Cannot modify header information – headers already sent by (output started at c:inetpubwwwrootutils.inc:13) in c:inetpubwwwrootstart.php on line 28
Warning: Cannot modify header information – headers already sent by (output started at c:inetpubwwwrootutils.inc:13) in c:inetpubwwwrootheader1.inc on line 22
Warning: Cannot modify header information – headers already sent by (output started at c:inetpubwwwrootutils.inc:13) in c:inetpubwwwrootheader1.inc on line 23
Warning: ociplogon(): OCISessionBegin: ORA-12705: Cannot access NLS data files or invalid environment specified
in c:inetpubwwwrootutils.inc on line 13
Die Lösung des Problems war dann das Setzen von zwei Systemvariablen:
NLS_LANG=AMERICAN_AMERICA.WE8MSWIN1252
ORA_HOME=C:oracleora92
Danach funktionierte der Oracle Datenbankzugriff aus Perl und PHP reibungslos.