|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-08-27 20:18 UTC] dave dot reddy at enbridge dot com
[2018-09-04 17:31 UTC] php at koenigskind dot net
[2018-12-08 10:29 UTC] sixd@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: sixd
[2018-12-08 10:29 UTC] sixd@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 12:00:01 2025 UTC |
Description: ------------ oci_pconnect using clear text credentials works as expected. oci_pconnect using OCI_CRED_EXT (Oracle Wallets) works only for the first PHP script run by a PHP FastCGI (php-fpm) child process. The second script run by the child process will think it finds a valid database connection, but the resource type is incorrect and nothing works. In the first script run, the resource returned by oci_pconnect has a resource type of "oci8 persistent connection". In subsequent scripts run by the same child fpm process, the resource type is "unknown", the data type is shown as "resource (closed)". Test script: --------------- <?php $sql = "select to_char(sysdate, 'dd-Mon-yyyy hh24:mi:ss') \"DATE\" from dual"; echo "Connection Test 1\n"; // You'll need to setup an Oracle Wallet for the credentials $conn = oci_pconnect("/", "", "DEV9_DASHBOARD", null, OCI_CRED_EXT); print_r(gettype($conn)); echo "\n"; print_r(get_resource_type($conn)); echo "\n"; if ($conn === false) { echo "Connection dead\n"; } else { $stmt = oci_parse($conn, $sql); if ($stmt === false) { echo "oci_parse returns FALSE\n"; } else { oci_execute($stmt); $row = oci_fetch_array($stmt, OCI_ASSOC+OCI_RETURN_NULLS); var_dump($row); sleep(1); } } ?> Expected result: ---------------- Expected Results (this is the result the first time script is executed) Connection Test 1 resource oci8 persistent connection array(1) { ["DATE"]=> string(20) "27-Aug-2018 15:09:26" } Actual result: -------------- When the fpm child process runs the same script a 2nd or subsequent time, the following results. Connection Test 1 resource (closed) Unknown Warning: oci_parse(): supplied resource is not a valid oci8 connection resource in /website205/PHPTEST/webapps/php/util/testoci.php on line 22 oci_parse returns FALSE