This discussion is archived
1 Reply Latest reply: Oct 1, 2011 4:25 PM by cj RSS

ORA-03106: fatal two-task communication protocol error

856988 Newbie
Currently Being Moderated
Hi there,
we are new to PHP, the programmer is learning as he is building the app.
The database is set to use the UTF8 character set. Application works from local m/c (OS=vista, client=11.1, PHP-5.3 with OCI-8).

However, when the same app run on (Red Hat Enterprise Linux Server release 5.7; ora client - 11.2, php-5.3 with OCI-8), we get following errors:

******************************************

thrown in /xxxxxxx/dean_njcphp/includes/database.oracle.inc on line 955

[29-Sep-2011 15:11:10] PHP Warning: SQLSTATE[HY000]: General error: 3106 OCIStmtExecute: ORA-03106: fatal two-task communication protocol error
(/staging/php/php-5.3.3/ext/pdo_oci/oci_statement.c:146)
query: UPDATE "SESSIONS" SET uid_ = :d0, cache = :d1, hostname = :s2, session_ = :s3, timestamp = :d4 WHERE sid = :s5
args: Array
(
[0] => 0
[1] => 0
[2] => 10.208.7.252
[3] =>
[4] => 1317323470
[5] => aga4s1eulccn5gr65pf0deh073
)
unformatted: UPDATE {sessions} SET uid = %d, cache = %d, hostname = '%s', session = '%s', timestamp = %d WHERE sid = '%s' in /sphapps/dean_njcphp/includes/database.oracle.inc on line 814

******************************************

The NLS parameter is being set in the Apache startup script, however this does not seem to be visible to PHP.

phpinfo() gets the following environment variable;

NLS_LANG      American_America.UTF8

BUT matching NLS_LANGUAGE under PHP variable doesn't show up even if we were to force via putenv() within php script.

SERVER["NLSLANGUAGE"]


Any help/direction on this is appreciated.

Best regards,
NK
  • 1. Re: ORA-03106: fatal two-task communication protocol error
    cj Employee ACE
    Currently Being Moderated
    If you're using the system Apache, try exporting environment variables including LD_LIBRARY_PATH, NLS_LANG etc in /etc/sysconfig/httpd. Make sure Apache has access to the Oracle libraries and NLS message files.

    The error is coming from PDO_OCI, which is different from OCI8. I can't recommend using PDO_OCI. It has known crashes and isn't maintained. It doesn't have the features that OCI8 has.

    The Oracle globalization manual says NLS_LANGUAGE is "Initialization parameter and ALTER SESSION" but doesn't say it an environment variable. It is derived from the NLS_LANG environment variable. So, I'd expect to see only NLS_LANG in phpinfo.

    Don't ever use putenv() in the .php file for Oracle environment variables because Oracle may get initialized before the PHP script runs, and inconsistent variable setting could be used.

    Finally, I recommend developing using the same platform as the intended deployment platform. There are plenty of subtle and not so subtle differences in PHP between Windows and Linux.

    If you start using OCI8, there are some tips in http://www.oracle.com/technetwork/topics/php/underground-php-oracle-manual-098250.html.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points