Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

oci_pconnect with tls problems

Ivanov SergeyMar 28 2017 — edited Apr 4 2017

Hi. I try to use persistent connection to database with tls protocol. Also i use nginx and php-fpm.

First 6 connections to db are established. Next connection is broken. This means that i have php warning: oci_parse(): supplied resource is not a valid oci8 connection resource.

For tests I use simple code:

ini_set('error_reporting', E_ALL);

ini_set('display_errors', 1);

function errorsHandler($errno , $errstr) {

    echo "Errno: " . $errno . "\n";

    echo "Errstr: " . $errstr . "\n";

    die();

}

set_error_handler('errorsHandler');

$conn = oci_pconnect('/', '', 'SECUREDCONNECTION','AL32UTF8',OCI_CRED_EXT);

if (!$conn) {

  die("Connection problems: " . oci_error());

}

$stid = oci_parse($conn, 'select * from p2p_accounts where account_number = :account_number');

$value = '4080************2622';

oci_bind_by_name($stid, ':account_number', $value, -1, SQLT_CHR);

oci_execute($stid);

echo "<table border='1'>\n";

while ($row = oci_fetch_assoc($stid)) {

  echo "<tr>\n";

  foreach ($row as $k => $v) {

    echo "    <td>" . $k . ' = ' . $v . "</td>\n";

  }

  echo "</tr>\n";

}

echo "</table>\n";

oci_free_statement($stid);

Also if I use oci_connect() function, all works fine. Also if I use oci_pconnect() function without tls protocol all works fine.

I confused where I wrong?

PHP version: 7.0.15

Oracle Run-time Client Library Version 12.2.0.1.0

Oracle Compile-time Instant Client Version 12.2

Env variables are:

env[LD_LIBRARY_PATH] = /usr/lib/oracle/12.2/client64/lib

env[ORACLE_HOME] = /usr/lib/oracle/12.2/client64/

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on May 2 2017
Added on Mar 28 2017
11 comments
3,331 views