php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27869 Assigning MySQLi_connect to a variable crashes PHP
Submitted: 2004-04-05 10:37 UTC Modified: 2004-12-11 01:30 UTC
Votes:4
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:3 (100.0%)
From: Robin at RHarmsen dot nl Assigned: andi (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5CVS-2004-04-08 OS: Windows XP
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: Robin at RHarmsen dot nl
New email:
PHP Version: OS:

 

 [2004-04-05 10:37 UTC] Robin at RHarmsen dot nl
Description:
------------
When assigning the result of MySQLi_connect() to a variable crashes PHP.
while just calling MySQLi_connect() with the same arguments doesn't crash.

I run Apache 2.0.49 Win32 on Windows XP with the Latest PHP5 CVS version.

PHP.ini diff:
zend.ze1_compatibility_mode = On
allow_call_time_pass_reference = Off
error_reporting  =  E_ALL
register_argc_argv = Off
extension_dir = "C:\php\ext\"
extension=php_mysqli.dll
mysqli.default_host = barserver


Reproduce code:
---------------
<?php
//this is good:
mysqli_connect("barserver","baruser","barpass");
// This crashes
$foo = mysqli_connect("barserver","baruser","barpass");
?>

<?php
// when disabeling mysqli and enableing mysql extension
// this is good:
$foo = mysql_connect("barserver","baruser","barpass");
?>

Expected result:
----------------
I expected that $foo would be assigned a mysqli link or mysqli object.

Actual result:
--------------
Apache + PHP crashes

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-09 06:21 UTC] Robin at RHarmsen dot nl
I tried the latest:
http://snaps.php.net/win32/php5-win32-200404081830.zip
Built On: Apr 08, 2004 18:30 GMT

and that one still has the crash
 [2004-04-09 13:32 UTC] sniper@php.net
This causes the crash:

zend.ze1_compatibility_mode = On

(if it's OFF, the thing works as expected!)

 [2004-04-14 15:13 UTC] Robin at RHarmsen dot nl
So I will never be able to use zend1 compatibility mode and MySQLi at the same time?

this would be very handy to revice old PHP4 code so it uses MySQLi and still run the code in compatibility mode for the time being (just in case some stuff doesn't work in PHP5 directly)
 [2004-04-14 15:45 UTC] derick@php.net
No, he means that he found the cause and that he could verify it. I just assigned it to the engine guru Andi, who hopefully has a look at it.

Derick
 [2004-12-11 01:30 UTC] andi@php.net
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at 
http://www.php.net/downloads.php

I'm pretty sure this has been fixed a while ago. Please try one of the latest releases (5.0.2?). If you still have this problem then please open a new bug report.
Thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 03:02:51 2024 UTC