I’ve installed the latest version of XAMPP on my Windows7 box because I wanted to do some testing with PHP 5.4. CodeIgniter and Community Auth seem to be running fine, yet testing revealed that any connection to the database resulted in about a 1 second lag.
The problem ends up being that Windows is trying to resolve “localhost” when used as my connection’s hostname, which is what I’ve always used. So instead I changed the hostname in CodeIgniter’s config/database.php to “127.0.0.1”. By doing that, Windows no longer feels the need to resolve “localhost”. There was still a problem though, and that was that I had to tell MySQL (or phpMyAdmin) that it is OK for connections to come from 127.0.0.1.
If you run the following SQL in your phpMyAdmin, you will be able to connect via 127.0.0.1:
GRANT ALL PRIVILEGES ON *.* TO user_name@‘127.0.0.1’ IDENTIFIED BY ‘pass_word’;
Make sure to change user_name and pass_word to your MySQL user’s real username and password, run the SQL, and restart MySQL (restarting may not be necessary). Page load times will now be normal (or at least they were for me).
Next, phpMyAdmin itself runs painfully slow for the same reason. Open up phpMyAdmin’s config.inc.php and add the following line:
$cfg[‘Servers’][$i][‘host’] = ‘127.0.0.1’;
XAMPP 1.8.0 now runs just as fast as my old XAMPP installation.
By the way, you don’t have to remove an old installation of XAMPP to run a new one on the same computer. They just can’t be running at the same time.