25

Finally, after hours of strugling, I finished installing PHP 7.02 on our IIS 7.5 Windows Server 2008. All functions properly except for one error:

[20-Jan-2016 15:19:26 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'D:\PHP\php-7.0.2-nts-Win32-VC14-x64\ext\php_mysql.dll' - The specified module could not be found. in Unknown on line 0

When checking the downloaded zip-file op PHP 7.02 it's clear that the folder ext doesn't contain a file called php_mysql.dll.

So my question is where can we get this file to avoid this error?

Cœur
  • 37,241
  • 25
  • 195
  • 267
DarkLite1
  • 13,637
  • 40
  • 117
  • 214
  • 9
    mysql_* functions was removed in PHP 7.0 and you can't use it with it – Thomas Rollet Jan 20 '16 at 15:22
  • So there's no way of getting rid of that error? Or maybe removing the `php_mysqli.dll` file from the `ext` folder will do? – DarkLite1 Jan 20 '16 at 15:23
  • 2
    Why remove the `php_mysqli` when it's the `php_mysql` that's giving you the error..? – Naruto Jan 20 '16 at 15:24
  • 8
    You shouldn't delete `mysqli` because that's the one that replaced `mysql`. What you should do is make sure that your webserver isn't loading `php_mysql.dll` but `php_mysqli.dll` – Daan Jan 20 '16 at 15:24

3 Answers3

64

Thanks to the comment of Naruto I figured out that the dynamic loading of all the modules in the php\ext folder wasn't the culprit. Because the file php_mysql.dll wasn't in that folder, so it couldn't be loaded from there. After further analyses it seems that in the latest PHP (7.02) download for Windows 64-bit the php.ini file still contains this:

[PHP_MYSQL]
extension=php_mysql.dll

After commenting out the section the error in the log file was gone. As we obviously can't load that dll file anymore.

;[PHP_MYSQL]
;extension=php_mysql.dll
DarkLite1
  • 13,637
  • 40
  • 117
  • 214
  • It looks like for PHP 7.1 there is only one line that needs to be commented out. – RenniePet Apr 02 '17 at 03:30
  • after giving a comment line, still wamp orange color, is any other possibilities of error? – Gem Oct 26 '17 at 12:22
  • This worked for me, to install composer.... not the same issue but similar!! upvoting anyway :D it worked!!! – Yorki Bonilla Feb 02 '18 at 01:10
  • Still getting this error for an older website after an upgrade to 7.2.10. The line extension=php_mysql.dll does not appear in this php.ini. (The non-deprecated line extension=pdo_mysql does appear. ) – FeralReason Sep 30 '18 at 20:14
  • 1
    can someone tell me why is this line still there in HP 8.2?? – McVitas Apr 08 '23 at 20:03
10

mysql extension was deprecated on v5.5 and removed on v7 please check out link below, https://wiki.php.net/rfc/remove_deprecated_functionality_in_php7

Cihan Uygun
  • 2,128
  • 1
  • 16
  • 26
2

For PHP 7.2 when using PDO for MySQL I had to un-comment the following line:

;extension=pdo_mysql

extension=pdo_mysql

It's worth noting that there are other versions of the PDO extension also commented out:

;extension=pdo_firebird
;extension=pdo_mysql
;extension=pdo_oci
;extension=pdo_odbc
;extension=pdo_pgsql
;extension=pdo_sqlite
B3none
  • 385
  • 3
  • 18