|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-04-30 10:58 UTC] bill dot macallister at prideindustries dot com
[2003-05-08 16:41 UTC] bill dot macallister at prideindustries dot com
[2003-05-09 01:02 UTC] bill dot macallister at prideindustries dot com
[2003-05-15 13:19 UTC] sniper@php.net
[2003-05-17 17:40 UTC] bill dot macallister at prideindustries dot com
[2003-05-18 11:50 UTC] sniper@php.net
[2003-05-23 11:23 UTC] bill dot macallister at prideindustries dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 21:00:01 2025 UTC |
This is as much a change in behavior as anything, but the specific failure seems to indicate a deeper problem. We have an application that uses out own session save handler to store session data in a MySQL database. This application has been in use on a 4.2.1 system for months now. When I upgraded our test system to 4.3.1 we started getting failures. The exact error was a MySQL connection failure because of bad authentication credentials. The error report indicated that the connection attempt was for webuser@localhost. Our Apache server runs as webuser so this is the default user. The code generating this message is: $mysql_host = 'mysql-master'; $mysql_user = 'phpuser'; $mysql_pass = 'phppass'; $mysql_db = 'php_sessions'; if ($cnx = mysql_connect ($mysql_host, $mysql_user, $mysql_pass)) { if ($db = mysql_select_db($mysql_db, $cnx)) { $ret = $cnx; } } So, the error message really is bogus or PHP's heap is corrupt. It turns out that I was able to make the error go away by changing the code: $s_user_id = $user_data["user_id"]; session_register("s_user_id"); to: session_register("s_user_id"); $s_user_id = $user_data["user_id"]; It appears that in 4.2.1 you can use variables before you register then and in 4.3.1 you cannot. The 4.3.1 behavior is at least a bug in that PHP silently accepts the invalid instruction sequence and corrupts its environment so that completely unrelated parts of the script will fail. If registration is required before use I would really like to see session_register complain if you try and do it wrong. Bill