Windows, Apache, PHP, MySQL and libmysql.dll

It seems like everytime I install a WAMP (Windows, Apache, PHP, MySQL) environment and I install php via the .zip file, I run into the same problems viewing PHPMyAdmin because it say's “Cannot load mysql extension.” So I did this to help me remember and hopefully help you out.

Configure php.ini

  1. add this to httpd.conf “PHPIniDir “C:/php/php.ini”"
  2. un-comment this line: extension=php_mysql.dll

Copy libmysql.dll

  1. Add your php folder to the path, for this example: c:\php
  2. Open Command Prompt. Win+R, type cmd
  3. net stop “apache2.2″
  4. copy c:\php\libmysql.dll c:\windows\system32
  5. net start “apache2.2″

Now your PHPMyAdmin or other program should work as expected.