Jump to content
View in the app

A better way to browse. Learn more.

The Uniform Server Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PHP 5.3.1 not working well with MySQL on Windows 7

Featured Replies

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.";
?>

  • 1 month later...

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.

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 ;)

  • 4 weeks later...
  • Author

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.

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

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.