Jump to content
The Uniform Server Community
Sign in to follow this  
PacFox

PHP 5.3.1 not working well with MySQL on Windows 7

Recommended Posts

I tried out the latest version (Nano-5.5) of Uniform Server and found that it would timeout while trying to connect to anything using MySQL other than phpMyAdmin in the admin panel. After much fiddling around I was able to pinpoint the problem down to PHP 5.3.1 after I switched it with PHP 5.3.0 from Nano-5.1 and found I could connect again. I've only tested on Windows 7 (I use the Professional x64 version) so I don't know if it happens on other OSs.

 

This is the code that I used to test (works with 5.3.0, timeout on 5.3.1):

<?php
error_reporting(0);
$connect = mysql_connect("localhost", "root", "root");
$connect;
echo "Connection was ";
if (!$connect) { echo "not"; } echo " successful.";
?>

Share this post


Link to post
Share on other sites

A useful post, thank you. I was finding the same problem using Windows 7 (64-bit) Home Premium and Nano-5.5.

 

I switched to Nano-5.1 and I can now connect to MySQL using php.

 

I have found that in Nano-5.1 the 'Server Status' component of the control panel does not work however because LIBEAY32.dll is missing.

Share this post


Link to post
Share on other sites

There is a bug in 5.3.1

 

PhpMyAdmin works because it uses 127.0.0.1 instead of localhost it also uses extension mysqli

 

I think the bug ignores localhost and tries to connect to the MySQL server using IPV6.

 

Change your test code to

<?php
error_reporting(0);
$connect = mysql_connect("127.0.0.1:3306", "root", "root");
$connect;
echo "Connection was ";
if (!$connect) { echo "not"; } echo " successful.";
?>

Just wondering it that works.

 

I would be interested to see if 5.6 beta works? It uses 5.3.2RC1, which may have fixed this bug.

 

All the best

Ric ;)

Share this post


Link to post
Share on other sites

I have tried changing localhost to 127.0.0.1 and it does indeed work. On the subject of it being a PHP bug I've found this and this suggesting it's not going to be fixed.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...