php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36139 Problem with oci_parse()
Submitted: 2006-01-24 12:13 UTC Modified: 2006-02-16 01:00 UTC
Votes:4
Avg. Score:4.2 ± 0.8
Reproduced:4 of 4 (100.0%)
Same Version:4 (100.0%)
Same OS:0 (0.0%)
From: max__payne at list dot ru Assigned:
Status: No Feedback Package: OCI8 related
PHP Version: 5.1.2 OS: Win 2003 Server Standard R2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: max__payne at list dot ru
New email:
PHP Version: OS:

 

 [2006-01-24 12:13 UTC] max__payne at list dot ru
Description:
------------
Calls to oci_parse() sometimes hangs up server. Oracle server is Oracle 8.1.7.0.0 with update to 8.1.7.2.1 running under Windows 2000 Server SP 4 (P IV CPU).

With older versions of PHP (5.0.5) this code works fine.

Reproduce code:
---------------
$connection = oci_connect($username, $password, $tns_name);

$st = oci_parse($connection, "SELECT * FROM nextmonthbirthdays");

oci_execute($st, OCI_DEFAULT);

$res = oci_fetch_assoc($st);

while($res)
{
    echo $res{"FIO"} . "<br>";
    $res = oci_fetch_assoc($st);
}

oci_free_statement($st);
oci_close($connection);

Expected result:
----------------
List of names one per line expected, instead see nothing while script is running.

Actual result:
--------------
Script above has no output, it hangs up server.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-24 12:28 UTC] tony2001@php.net
What version of client libraries are you using?
 [2006-01-24 19:26 UTC] max__payne at list dot ru
Oracle Call Interface

Revision: 1.257.2.8
 [2006-01-24 20:15 UTC] tony2001@php.net
>Oracle Call Interface
I'm sure it's OCI, but I was asking about its version.
I mean are you using Oracle Instant Client _10_ or old libraries from Oracle _8i_ or _9i_ ?

Short version: install Instant Client and see if it works.
 [2006-01-25 08:25 UTC] max__payne at list dot ru
I use client Oracle 9i client libraries. They are not compatible with PHP 5.1.2?
 [2006-02-02 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2006-02-08 07:00 UTC] v_afan at fareastone dot com dot tw
I am aware that the issue is reported by someone else on prior versions of PHP 5.x, and I am aware the issue is reportedly resolved, but the crash problem of the PHP 5.x SAPI for Apache appears to have risen again.

I used the following code on PHP 5.1.2 (SAPI) on both Apache 2.0 (official binaries) and 2.2 (compiled SAPI module with VC .Net 2003) on Windows XP SP2, and Apache would crash with a Windows dialog box that indicates the crash.  Through trial and error through comment blocks, I found that Apache crashed upon executing "OCI_PARSE($conn,$sql);", where the connection to the Oracle DB server via a local client appears to have been successful (Oracle client 8.1.7.0.0 connecting to Oracle server 8.1.7.4.0).

Interestingly though, the following code does work successfully (as expected) for both Apache 2.0 and 2.2 when used in conjunction with their corresponding PHP SAPI modules from PHP 5.1.1 on the same combination of OS, compiler, oracle client and server.

Thanks for the time, and I would still like to thank the PHP devs on their works on this great program.

--------------CODE used to trigger the crash on PHP 5.1.2--

<?
  $un = 'someone';
  $pw = 'foo';
  $db = 'somedb';
  
  $conn = oci_connect($un, $pw, $db);
		
  if (!$conn)
  {
    echo("DB Connection failed!");
    exit;
  }
		
  $dev_id = $_POST["dev_id"];
		
  $sql = 'SELECT FOO FROM SOME_TABLE WHERE DEV_ID = :DEV';
  $qry = OCI_PARSE($conn,$sql);
  
  OCI_BIND_BY_NAME($qry, ":DEV", $dev_id, -1);
		
  OCI_EXECUTE($qry);
		
?>
 [2006-02-08 09:16 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.1-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.1-win32-latest.zip


 [2006-02-16 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2006-03-14 20:48 UTC] gcamacho79 at yahoo dot com
"Through trial and error through comment blocks, I
found that Apache crashed upon executing "OCI_PARSE($conn,$sql);", where
the connection to the Oracle DB server via a local client appears to have been successful" 
-----------------------------------------------------------
I had the same problem and I fixed it. I recently upgraded from PHP 4.2 to PHP 5.1.2 and suddenly my PHP/Oracle scripts were not working. Apache would just crash everytime I called oci_parse(). I fixed the problem by downloading a new php_oci8.dll from this site:
http://pecl4win.php.net/ext.php/php_oci8.dll

My scripts started working instantly after I replaced the php_oci8.dll from the PHP 5.1.2 with the one from this website.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 30 16:01:29 2024 UTC