PHP Function makes Apache to crash. Everytime. Help!

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
kaisellgren
DevNet Resident
Posts: 1675
Joined: Sat Jan 07, 2006 5:52 am
Location: Lahti, Finland.

PHP Function makes Apache to crash. Everytime. Help!

Post 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!
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

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

Post by Benjamin »

User avatar
kaisellgren
DevNet Resident
Posts: 1675
Joined: Sat Jan 07, 2006 5:52 am
Location: Lahti, Finland.

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

Post 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...
Post Reply