How to resolve Fatal error: Class ‘mysqli’ not found / Unable to load dynamic library ‘c:\PHP\ext\php_mysql.dll’ – Access is denied.
July 31st, 2008 by Oliver - Tagged with MySQL, MySQLi, PHP - Posted in Web Platforms
After much digging around on the net and of course Google I managed to cobble together a trouble shooting process to find out why I was getting the error message:
Fatal error: Class ‘mysqli’ not found in E:\mysite\sql.php on line 17
PHP Warning: PHP Startup: Unable to load dynamic library ‘c:\PHP\ext\php_mysql.dll’ – Access is denied. in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library ‘c:\PHP\ext\php_mysqli.dll’ – Access is denied. in Unknown on line 0 PHP Fatal error: Class ‘mysqli’ not found in E:\mysite\sql.php on line 17
The server�setup�that I was getting this error on was:
Windows 2003 Server, IIS6, PHP 5.2.6 (FastCGI), MySQL 5.1.
After double and tripple checking my PHP config. & extentsion permissions with no sucess, I was digging arround on IIS.net to try and find a solution. I knew that it had to be a file permission somewhere, but where?! There is an article on IIS.net that tells you to use the SysInternals process monitor on IIS to find which files are being called / executed / etc. I have used this utility many times before but didn’t think of using it before I read this artice (come on brain get into gear!).
So I downloaded the monitor from here, and low and behold I found the problem! My copy of libmysql.dll that IIS was using didn’t have permissions for the IUSR_MACHINENAME account (replacing MACHINENAME with your boxes machine name!). Screenshots below.
As always, register and post for help.
Green2go
Searching For ‘mysqli’ keyword

Finding the ‘Access Denied’ error message

Viewing more information about the process with the error

Adding the correct permissions to ‘libmysql.dll’ located�at C:\WINDOWS\system32\libmysql.dll








