While trying to setup Apache, PHP and MySql on your development machine or server, you may face several hurdles and one of them would be unable to load the mysql library. On my windows development machine, I got a problem while trying to load mysql library. I got following error:
PHP Warning: PHP Startup: Unable to load dynamic library ‘./php_mysql.dll’ – The specified module could not be found.\r\n in Unknown on line 0
The problem is two fold here:
- The extension directory path is incorrect
- And php module isn’t able to find libmysql.dll
To resolve the issue:
- Update ‘extension_dir’ from ‘./’ to ‘G:/Server/php/ext/’
- Update the ‘PATH’ variable on your computer to include the PHP directory (G:\Server\php) in my case.
Hope this will save you time and trouble of finding a proper solution.