php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27553 odbc.ini file descriptors left open
Submitted: 2004-03-10 18:00 UTC Modified: 2004-03-15 11:10 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: bradleyb at trans-soft dot net Assigned:
Status: Not a bug Package: ODBC related
PHP Version: 4CVS-2004-03-11 OS: redhat 9
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: bradleyb at trans-soft dot net
New email:
PHP Version: OS:

 

 [2004-03-10 18:00 UTC] bradleyb at trans-soft dot net
Description:
------------
When i make a connection to my sybase db using odbc_connect, apache leaves the odbc.ini file open even thought i call odbc_close().

I am unable to figure out how to get these files closed. I have done quite a bit of research but am unable to locate any one who has experienced this issue.

Apache is the User assigned to the file which is located -> etc/odbc.ini

At the top of each page that i load is an include statement that creates a connection to the db.  When i have finished running my query (odbc_do()), i call odbc_close().

For each page that is loaded, a new instance of odbc.ini is opened for each call to odbc_connect().

I verify this by using -> lsof odbc.ini in the etc/ directory.

Reproduce code:
---------------
$db = odbc_connect($DSN, $dbUserName, $dbPassWord);

if(!$db)
{
   die("Failure to connect to DB");
}

if(@ $dbResource = odbc_do($db, $query))
{
   if(@ odbc_fetch_row($dbResource))
   {
      $myData = odbc_result $dbResource, "ColumnName");            
   }
   odbc_close($db);
}

Expected result:
----------------
The odbc.ini file descriptor located in the etc/ directory to be closed.

Actual result:
--------------
file is left open?
lsof odbc.ini

COMMAND   PID   USER   FD   TYPE DEVICE SIZE   NODE NAME
httpd   20268 apache    8r   REG    3,6 1105 244685 odbc.ini


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-03-10 19:45 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

Also give us your full configure line used to configure PHP.

 [2004-03-11 11:01 UTC] bradleyb at trans-soft dot net
Upated server to the latest stable version, but we are still encountering the problem with the odbc.ini file being left open by the apache process even with explicit call to odbc_close().

As requested, here is our configuration file (php.ini) path:
/opt/php4-STABLE-200403111430/lib/php.ini
 [2004-03-13 04:59 UTC] sniper@php.net
I was asking for the configure line you used to configure PHP sources befor 'make'. (you can find that in the phpinfo() output..)

 [2004-03-15 10:05 UTC] bradleyb at trans-soft dot net
configure line:

'./configure' '--prefix=/opt/php4-STABLE-200403111430' '--with-apxs=/opt/httpd/bin/apxs' '--with-unixODBC'
 [2004-03-15 11:10 UTC] sniper@php.net
PHP does not open odbc.ini file, it's the duty of unixODBC. And if unixODBC leaves the file open there is nothing PHP can do about it. Report to the unixODBC authors.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 22:01:26 2024 UTC