Page 1 of 1

PHP Function makes Apache to crash. Everytime. Help!

Posted: Sat Mar 07, 2009 10:08 am
by kaisellgren
Hi,

Whenever I use mysqli_stmt_fetch procedural or OO way, Apache crashes.

For instance, the following script crashes:

Code: Select all

$c = mysqli_connect('localhost','root','pass','test');
if ($stmt = mysqli_prepare($c,'SELECT username FROM admins WHERE id=1'))
{
mysqli_stmt_execute($stmt);
mysqli_stmt_bind_result($stmt,$a);
mysqli_stmt_fetch($stmt);
mysqli_stmt_close();
}
However, this will not crash:

Code: Select all

$c = mysqli_connect('localhost','root','pass','test');
if ($stmt = mysqli_prepare($c,'SELECT username FROM admins WHERE id=1'))
{
mysqli_stmt_execute($stmt);
mysqli_stmt_bind_result($stmt,$a);
die('I am here...');
mysqli_stmt_fetch($stmt);
mysqli_stmt_close();
}
And this crashes too:
ยจ

Code: Select all

$c = mysqli_connect('localhost','root','pass','test');
if ($stmt = mysqli_prepare($c,'SELECT username FROM admins WHERE id=1'))
{
mysqli_stmt_execute($stmt);
mysqli_stmt_bind_result($stmt,$a);
mysqli_stmt_fetch($stmt);
die('I am here...');
mysqli_stmt_close();
}
It will never output "I am here..." it just displays "Connection Interrupted" and when I look at the Services.msc (I am on Windows x64), the Apache service is not running.

I am running PHP 5.2.8 x64 and I also tried PHP 5.2.5 x64, but no difference. Newest version is 5.2.9, but it does not say it fixes this problem and I am unable to use 5.2.9, because I cannot find compiled x64 versions of it... and no I don't have the time to setup VS and all to compile it myself. I am running MySQL 5.1.

This is frustrating, I really need that to work!

Re: PHP Function makes Apache to crash. Everytime. Help!

Posted: Sat Mar 07, 2009 2:13 pm
by Benjamin

Re: PHP Function makes Apache to crash. Everytime. Help!

Posted: Sat Mar 07, 2009 7:23 pm
by kaisellgren
Oh my god. Finally! :D

I am using PHP 5.2.8 x64, MySQL 5.1 x64, Apache 2.2 x64 and everything seems to work great now.

I think the problem was only in PHP 5.2.5's Client Library, but I forgot to change the environment path variable to new PHP 5.2.8, so the old extensions were loaded...