1 Reply Latest reply on Oct 1, 2011 11:25 PM by cj

    ORA-03106: fatal two-task communication protocol error

      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
      query: UPDATE "SESSIONS" SET uid_ = :d0, cache = :d1, hostname = :s2, session_ = :s3, timestamp = :d4 WHERE sid = :s5
      args: Array
      [0] => 0
      [1] => 0
      [2] =>
      [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.


      Any help/direction on this is appreciated.

      Best regards,
        • 1. Re: ORA-03106: fatal two-task communication protocol error
          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.