Which PHP to Download?

Hi,

My System: Windows Vista Home Basic 32 bit
Apache 2.2.17
PHP 5.3.6
MySQL 5.5.11

Sorry for this very basic question but I am getting some errors while trying to connect to MySQL database and I am not sure if I am using the right version of PHP. Apache is running, MySQL is running and PHP scripts are working. But I got this warning when I tried to connect to MySQL:

[I]Warning: mysqli_connect() [function.mysqli-connect]: [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://127.0.0.1:3306) in C:\WEB\Apache\htdocs\ est\index.php on line 3

Warning: mysqli_connect() [function.mysqli-connect]: (HY000/2002): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\WEB\Apache\htdocs\ est\index.php on line 3

Unable to connect to the database server.[/I]

And here is the code I am using:

<?php

$link = mysqli_connect('127.0.0.1', 'root', 'mypassword');

if (!$link)
{
$output = 'Unable to connect to the database server.';
include 'output.php';
exit();
}

?>

I found some other posts about this problem but the solutions didn’t work for me.

I downloaded PHP from this page: PHP For Windows: Binaries and sources Releases

VC9 x86 Thread Safe (2011-Mar-22 13:27:32)
Zip [15.13MB]

And extracted into the folder where I will be using. I have no idea why I downloaded Thread Safe version and if I am missing any other files.

Try using

localhost

instead of 127.0.0.1

Are you sure your mysql server is running properly? The error message hints that it’s not. You could try connecting using the mysql command line program or workbench. I’d verify the db is correct before troubleshooting the php code.

Sorry, I forgot to update this thread. I solved this long ago. Thanks.