good day
On a VPS Ubuntu server, the application is deployed (oracle-XE + PHP), running apache2. PHP communicates with the database via oci8.
All values that return from the database to the page are returned in the form "?????????". Ie, all Cyrillic is unreadable. At the same time, static text on the page is reflected correctly.
At the same time, on another VPS server everything works fine. Obviously, where there is a difference in the configs, but so far I have not found where.
SELECT * FROM V$NLS_PARAMETERS NLS_LANGUAGE AMERICAN NLS_TERRITORY AMERICA NLS_CURRENCY $ NLS_ISO_CURRENCY AMERICA NLS_NUMERIC_CHARACTERS ., NLS_CALENDAR GREGORIAN NLS_DATE_FORMAT DD-MON-RR NLS_DATE_LANGUAGE AMERICAN NLS_CHARACTERSET AL32UTF8 NLS_SORT BINARY NLS_TIME_FORMAT HH.MI.SSXFF AM NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR NLS_DUAL_CURRENCY $ NLS_NCHAR_CHARACTERSET AL16UTF16 NLS_COMP BINARY NLS_LENGTH_SEMANTICS BYTE NLS_NCHAR_CONV_EXCP FALSE
Also in all php scripts that return values, there is a line:
header('Content-Type: application/json; charset=utf-8');
Also in apache2.conf I tried to add
AddDefaultCharset Utf-8
did not help.
.bashrc
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe export ORACLE_SID=XE export NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh` export ORACLE_BASE=/u01/app/oracle export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH export PATH=$ORACLE_HOME/bin:$PATH NLS_LANG=AMERICAN_AMERICA.CL8MSWIN1251 LANG=en_US.C
SELECT returns the Cyrillic text directly from the database correctly
NLS_LANG=RUSSIAN.AL32UTF8
before connecting to the database. php is unlikely to perform .bashrc. it is also possible to indicate directly in the code via putenv or somehow transfer it to the driver. - Mike