Closed (fixed)
Project:
Drupal core
Version:
x.y.z
Component:
database system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Nov 2005 at 16:02 UTC
Updated:
16 Dec 2005 at 04:01 UTC
Jump to comment: Most recent file
Comments
Comment #1
m3avrck commentedBeen using on dev seems to be good, no prob here.
Comment #2
dries commentedJust wondering; won't that call the session_write_close() function twice?
Comment #3
m3avrck commentedDries, not sure I understand why that function would be called twice. PHP 5.0.5 and 5.1 changed the way this function is called (if at all) so I don't think it is being called twice. But I can assure you, without that function declared like that, Drupal won't run on PHP 5.0.5+ properly. Doesn't seem to be much out there on this issue, just lots of problems with it, solution coincides with what the main PHP developers were saying in that comment.
Comment #4
m3avrck commentedHere's an update cumaltive MySQLi patch that fixes the problem noted here: http://drupal.org/node/37863
Comment #5
dries commentedAre you saying that PHP 5.0.5 no longer calls session_write_close(), unless you register a shutdown callback for it?
I'd think session_write_close() is still called, but to late in the request. By registering a shutdown callback for it, we might be calling it twice, or does registering a shutdown callback remove the original call to session_write_close()? Or am I missing the point and is session_write_close() something special that never gets called unless used as a shutdown callback? I just want to make sure we're not doing too much work. Closing a session involves 1-2 SQL queries so ...
Comment #6
m3avrck commentedDries it is my understanding that by using register_shutdown_function() it changes the order in which functions are called, it doesn't call them twice. So when the __destruct() is called right now in 5.0.5+, session write and close are called right after. With the register_shutdown(), it'll call __destruct() but before that executes, it now calls write and close, and then everything is destroyed.
If you have a look at the comments here (just the first few) I think their examples will explain this in better detail: http://bugs.php.net/bug.php?id=33772
Notice, that in the first 3 comments, the order of calls is changed (not duplicated), restoring this to previous versions of PHP. Oddly enough, this only affects MySQLi.
Hope that makes more sense. Apparently PHP 5.1 is due out in less than a week now (on the 24th) and this patch is going to be needed if anyone wants to upgrade to that (I'm looking into deploying that on our server as it has the potential to speed up Drupal, I'll try and get benchmarks).
Comment #7
dries commentedCommitted to HEAD. Thanks.
Comment #8
reuben commentedI've been seeing this message on HEAD for a few days now:
Warning: Couldn't fetch mysqli in /var/www/html/drupal-cvs/includes/database.mysqli.inc on line 346
It always appears at the bottom of the page, below the footer.
I'm running the php-5.0.5 RPM with mysqli on Fedora Core. If I revert to just 'mysql' it seems to work OK.
Am I the only person seeing this problem?
Comment #9
m3avrck commentedHi, if you read at the top you'll notice that this is a bug with PHP 5.0.5 *only*. PHP introduced a bug into this version only that caused this. Either upgrade to 5.1.1 or downgrade to 5.0.4. Thanks!
Comment #10
(not verified) commented