Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > pdo-oracle + nls_lang environment variable...
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 11th March 15:27
jruizmail
External User
 
Posts: 1
Default pdo-oracle + nls_lang environment variable...


Hi,

I'm using pdo-oci on php-5.2.2 against an oracle-10g server, using
oracle-instantclient (compiled oracle with
'--with-oci8=instantclient,/usr/lib/oracle/10.2.0.3/client/lib').

The problem...:
I make a simple php script that makes a select from a table. The table
contains spanish characters so I set the enviroment variable NLS_LANG to
SPANISH_SPAIN.AL32UTF8 before running apache (also tried other values that
use iso8859-1...). If I run the script in console (using the CLI version of
php) the returned data is in the desired collation, so I can see the spanish
special characters like "ñ", "ó" and so on... The problem is that running
exactly the same script via HTTP (apache2) I always get question marks
replacing the special characters...

I tried many things... I export the enviroment variable as root and as the
user running the apache daemon, I modified the apache init script to export
the variables just before starting apache, I tried using the putenv function
in php code and no luck at all...

I realized about something that maybe is related... a php script running in
CLI can access any environmental variable, but no any env-var running in
apache... for example the following code: <?php echo getenv("LC_ALL"); ?>
will return my locale setting in CLI but returns nothing via http... is it
normal?

TIA!
  Reply With Quote


  sponsored links


2 11th March 18:56
migueljose.jimenez
External User
 
Posts: 1
Default pdo-oracle + nls_lang environment variable...


Javier Ruiz escribió:

Maybe you have the AddDefaultCharset directive from Apache2 set to
ISO-8859-15 instead of UTF-8 (or even off)? I have worked with php-oci8
and php5.2 without any collation problem this far (using ñ € ans so on...)

--
Miguel J. Jiménez
Programador Senior
Área de Internet/XSL/PHP
migueljose.jimenez@isotrol.com

----------------------------------------------------

ISOTROL
Edificio BLUENET, Avda. Isaac Newton nº3, 4ª planta.
Parque Tecnológico Cartuja '93, 41092 Sevilla (ESP).
Teléfono: +34 955 036 800 - Fax: +34 955 036 849
http://www.isotrol.com

"You let a political fight come between you and your best friend you have in all the world. Do you realize how foolish that is? How ominous? How can this country survive if friends can't rise above the quarrel".
Constance Hazard, North & South (book I)
  Reply With Quote
3 11th March 18:57
jruizmail
External User
 
Posts: 1
Default pdo-oracle + nls_lang environment variable...


sorry, forgot to CC to the list...

---------- Forwarded message ----------
From: Javier Ruiz <jruizmail@gmail.com>
Date: May 17, 2007 9:46 AM
Subject: Re: [php] pdo-oracle + nls_lang environment variable...
To: "Miguel J. Jiménez" <MiguelJose.Jimenez@isotrol.com>

Thanks for the answer.

Nah I checked and apache has support for both latin1 and utf8 charsets, I
tried anyway forcing the output of apache to iso8859-1 and to utf8 but no
luck...

I'm almost convinced it's something about php reading the NLS_LANG
environment variable because if I just unset this variable php-cli (and even
oracle's sqlplus directly) behaves the same way as php-apache does (displays
special characters as question marks).

gracias miguel :-D
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666