Wednesday, June 18, 2008

PHP Warning: PHP Startup: Unable to load dynamic library 'php_mysql.dll' - The specified procedure could not be found.

Well, i m highlighting this line, so that you all vl know the intensity with which this one has bugged me. Yeah, i was struggling with this one for 3 looooooonnnnnnng days.. After trying my hand @ jsp now jus came in the php-room to have a lil bita dancing in the party.. ;D... well, first i installed php5+apache2.2+mysql5.0.41. It was gr8 to see the hello world on my browser. I then thought of creating a small application insert, update, delete. But guess what?? i started getting the above error. After a lotta googling around, on 90% of the forums i found only a single answer, i.e. this bug is with the libmysql.dll supplied with Mysql, so weel have to use the libmysql.dll supplied with the zip installer.
Reinstalled php using php zip package, but no luck.
Only solution to this i found on somewhere third page of a google result was resolve this error using the Apache way.
Jus add following lines to ur Apache httpd.conf file and it does it all. No need to copy any dll's.

LoadFile "C:/Software/PHP/libmysql.dll"
PHPIniDir "C:/Software/PHP/"

LoadModule php5_module "C:/Software/PHP/php5apache2_2.dll"


Well, what apache does is its loads the specified dll before any one else search for it. Thanx to Apache and Sander for finding this out. Well this guy has kept his comments Off, so i cudnt thank him on his blog.. No matter. Now my php5+mysql5.51+Apache2.2 on Windows is working like a Maska [Desi word for smooth ;)]

Please change your directory accordingly in the path. Above code is specific to my settings.
Tip: Dont rely on the MSI- Installer of php. Windows go mad, use the zip installer, works gr8!

njoy ;)

No comments: