Windows Apache, PHP and Mysql Install Problems and Solutions
Having problems with installing the PHP Windows version and Mysql?
No doubt it can be a frustrating experience, especially if you are new to PHP, Mysql, and Apache. Here are some common problems and solutions that I have run into over the years.
Create Separate Folders For PHP, Apache, and Mysql
I can't emphasize this one enough. Make sure you install PHP in the c:\php folder, Mysql in the c:\mysql folder, and Apache 2 in the c:\apache2 folder. Keep them separate and don't try to do anything fancy. This will help narrow down problems if they arise. Do not install them in the c:\program files folder.
Libmysql.dll Must Be In Path
There is a problem in the way the PHP guys have distributed their release that can cause install problem with the Mysql database. The two extensions, php_mysql.dll and php_mysqli.dll both invoke libmysql.dll. Unless libmysql.dll is in your PATH or Windows/Windows32 directory you will come up with errors.
For example, Drupal users may see this error message:
"Your web server does not appear to support any common database types. Check with your hosting provider to see if they offer any databases that Drupal supports"
You must enable the extension in PHP.INI:
Then, copy libmysql.dll to the Windows32 directory or somewhere in your PATH. It won't work if you place it in the ext directory along with the other mysql DLLs. It behooves me after all these years why the PHP guys simply won't do the following:
Distribute/install php_mysql.dll, php_mysqli.dll, and libmysql.dll in the /php/ext directory
Simply make a LoadLibrary("./libmysql.dll") in DllMain() on the DLL_PROCESS_ATTACHED