php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12077 php.exe application error - cannot 'read' memory address
Submitted: 2001-07-12 00:06 UTC Modified: 2001-08-19 04:13 UTC
From: mark at catalyst dot net dot nz Assigned:
Status: Not a bug Package: OCI8 related
PHP Version: 4.0.6 OS: windows 2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mark at catalyst dot net dot nz
New email:
PHP Version: OS:

 

 [2001-07-12 00:06 UTC] mark at catalyst dot net dot nz
i'm using php 4.0.6 through IIS5 on a windows 2000 workstation.

this is similar to bug #11202, except it occured to me while i was using oci8 as apposed to MS SQL (which worked fine for me).

my exact error is 'php.exe - application error:
the instruction at "0x77f83a33" referenced memory at'
"0x00000010". The memory could not be "read".

when i click "OK" to terminate the program, the script seems to complete it's execution as i want, just with the painful error showing.
if i click on "CANCEL", it's like it's in an endless loop.
btw - i'm trying to connect to an 8i 8.1.6 database.

so i'm not really sure if it's an oci8 problem or whether it's an IIS5 or windows 2000 problem.

here is a sample script which i am using.

<html>
<title>Default php load file.</title>
<body>
<?php
  include("classes.php");

  // test for MS SQL server. This part works without errors.
  // Create new connection.
  $mssql_conn = new Connection($database_name, $database_type, $server_name, "webuser", "webuser");

  //test connection with a simple SELECT call.
  $SQL = "SELECT * from role_type ";
  $result = $mssql_conn->exec($SQL);
  echo $result;
  echo "<br>";
  echo mssql_num_rows($result);
  echo "<br>";
  echo "<br>";

  // Test for oracle database..
  // This part produces the error.
  $ora_conn = new connection("PS_PLATO", "ORA", "PLATO", "psadmin", "d3g3sh");
  $SQL = "SELECT * from advert ";
  $result4 = $ora_conn->exec($SQL);
  echo "result of exec statement " . $result4;
  echo "<br>";
  echo ocinumcols($ora_conn->stmt);
  echo "<br>";
  echo "<br>";
?>

this is the classes.php include file.
<?php

  class Connection
  {
    // Variables
    var $connect_to;
    var $server;
    var $database;
    var $db;
    var $stmt;

    // Constructor
    function Connection($database_name, $database_type, $server_name = "", $username = "", $password = "", $port="")
    { 
      if ($database_name != "" && $database_type != "")
      {
	$this->connect_to = $database_type;
	$this->server = $server_name;
	$this->database = $database_name;

	switch ($database_type) {
	  case "MSSQL":
		$this->db = mssql_connect($server_name, $username, $password);
		if ($this->db <> false) 
		{
		  $done = mssql_select_db($database_name, $this->db);
		}
		break;
	  case "ORA":
		$this->db = ocilogon($username, $password, $database_name);
		break;
	  case "ODBC":	
		$this->db = odbc_connect($database_name, $username, $password);
		break;
	  case "PGSQL":
		$this->db = pg_Connect("host=$server_name port=$port dbname=$database_name user=$username");
		break;
	  default:
		echo "<font face=tahoma>Invalid or Unsupported database type.</font><br>";
	}
      } else {
        echo "<font face=tahoma>Information missing in connection string.</font><br>";
      }
    }

    // Functions
    function exec($SQL)
    // for the DML calls to databases.
    {   echo $this->connect_to;
        echo "<bR>";

	switch ($this->connect_to) {
	  case "MSSQL": 	return mssql_query($SQL, $this->db); 	break;
	  case "ODBC": 		return odbc_exec($this->db, $SQL); 	break;
	  case "PGSQL":		return pg_exec($this->db, $SQL);	break;
	  case "ORA":		$this->stmt = ociparse($this->db, $SQL);
				return ociexecute($this->stmt);		break;
	  default:
		echo "<font face=tahoma>Invalid or Unsupported database type.</font><br>";
	}
    }
  }
?>

this is meant to be a basic database wrapper - you pass in a database type, name, server name, username, password and a port number(for those dbases that need it), and it opens a valid connection to that dbase. then you can perform standard commands like the execution of an sql statements and the standard php-database funcitons like num_rows etc.

refreshing the pages does little more than represent the error to the screen.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-12 00:15 UTC] mark at catalyst dot net dot nz
well - i appear to have found the problem.

in the php.ini file, there are 2 oracle extensions.
extension=php_oci8.dll and extension=php_oracle.dll.

i had both of these extensions loaded, and they must have been conflicting. because when i commented out the oracle.dll extension, restarted IIS5 and re-ran the scirpt, it worked fine without causing the error to appear.
 [2001-08-19 04:13 UTC] sniper@php.net
user error

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 12:01:30 2024 UTC