php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34550 database connections "dissappears" at custom session handlers
Submitted: 2005-09-19 17:05 UTC Modified: 2005-09-21 15:26 UTC
From: rudy dot metzger at pareto dot nl Assigned:
Status: Not a bug Package: Session related
PHP Version: 5.0.5 OS: Redhat ES 3
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: rudy dot metzger at pareto dot nl
New email:
PHP Version: OS:

 

 [2005-09-19 17:05 UTC] rudy dot metzger at pareto dot nl
Description:
------------
When using customer session handlers, the database connection during the write is no longer valid (when using mysqli).

Reproduce code:
---------------
http://parlnx01.pareto.nl/phpbug

Expected result:
----------------
a valid database connection. in above case, a return value of TRUE from the ping. Curios is that ping should return true/false, but acutally we got NULL.

Actual result:
--------------
a lost database connection, ping returns NULL. it is also impossible to execute queries or issue statements (no DB connection anymore).

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-19 17:09 UTC] tony2001@php.net
403 Forbidden
You don't have permission to access /phpbug/ on this server.
 [2005-09-19 17:20 UTC] rudy dot metzger at pareto dot nl
fixed, was still in the process of setting it up. sorry
 [2005-09-19 17:39 UTC] tony2001@php.net
Please try using this CVS snapshot:

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

Works perfectly fine here.
 [2005-09-20 10:47 UTC] rudy dot metzger at pareto dot nl
Same problem with the snapshot version, see output below:
---------------------------------------------------------
The link identifier after connect. it is valid<br>
object(mysqli)#3 (0) {
}
Ping of the DB. Returns true, we can ping it<br>
bool(true)
PHP Warning:  session_start(): Cannot send session cookie - headers already sent by (output started at /var/www/zwizzle/zcm/public/test.php:36) in /var/www/zwizzle/zcm/public/test.php on line 22
PHP Warning:  session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/zwizzle/zcm/public/test.php:36) in /var/www/zwizzle/zcm/public/test.php on line 22
Writing, now it goes wrong! ping returns NULL, which is undefined!<br>
PHP Warning:  Couldn't fetch mysqli in /var/www/zwizzle/zcm/public/test.php on line 61
NULL
-------------------------------------------------------
The problem is the NULL in the very last line

I am using for MySQL
MySQL-shared-standard-4.1.14-0.rhel3
MySQL-devel-standard-4.1.14-0.rhel3
and my linux is
Linux www1.zwizzle.nl 2.4.21-32.0.1.ELsmp #1 SMP Tue May 17 17:52:23 EDT 2005 i686 i686 i386 GNU/Linux
(Redhat ES3)
Configured with
./configure --with-apxs2 --with-mysqli=/usr/bin/mysql_config --with-gd --with-zlib --with-openssl --enable-pcntl --with-curl --enable-mbstring

I reinstalled php-5.0.4 again, and everything works again (the NULL is then boolean(true))
 [2005-09-20 11:14 UTC] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 [2005-09-21 14:38 UTC] rudy dot metzger at pareto dot nl
Sorry to be such a pain in the a$$, but i cannot agree to this. I did more tests and updated my page at http://parlnx01.pareto.nl/phpbug/ with more info. Maybe it was a misunderstanding/misinterpretation of my error report.

Please have a look again at the url, as this error is 100% reproduceable for me, on various platforms with various MySQL version. So it seems to be a bug of PHP (the mysqli extension?).
 [2005-09-21 15:26 UTC] sniper@php.net
Call session_write_close() in the object's __destruct()
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 16 16:08:09 2025 UTC