php php_mysql.dll 发生了什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/34903896/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What happened to php_mysql.dll?
提问by DarkLite1
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:
最后,经过几个小时的挣扎,我在 IIS 7.5 Windows Server 2008 上完成了 PHP 7.02 的安装。 除了一个错误外,所有功能都正常:
[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
[2016 年 1 月 20 日 15:19:26 UTC] PHP 警告:PHP 启动:无法加载动态库 'D:\PHP\php-7.0.2-nts-Win32-VC14-x64\ext\php_mysql.dll' - 指定的模块无法找到。在未知的第 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
.
检查下载的 zip 文件 op PHP 7.02 时,很明显该文件夹ext
不包含名为.zip 的文件php_mysql.dll
。
So my question is where can we get this file to avoid this error?
所以我的问题是我们在哪里可以得到这个文件来避免这个错误?
回答by DarkLite1
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\ext
文件夹中所有模块的动态加载不是罪魁祸首。因为该文件php_mysql.dll
不在该文件夹中,所以无法从那里加载。经过进一步分析,似乎在适用于 Windows 64 位的最新 PHP (7.02) 下载中,该php.ini
文件仍包含以下内容:
[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.
注释掉该部分后,日志文件中的错误消失了。因为我们显然不能再加载那个 dll 文件了。
;[PHP_MYSQL]
;extension=php_mysql.dll
回答by Cihan Uygun
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
mysql 扩展在 v5.5 上被弃用并在 v7 上被删除,请查看下面的链接,https://wiki.php.net/rfc/remove_deprecated_functionality_in_php7
回答by B3none
For PHP 7.2 when using PDO for MySQL I had to un-comment the following line:
对于 PHP 7.2,在将 PDO 用于 MySQL 时,我必须取消注释以下行:
;extension=pdo_mysql
;extension=pdo_mysql
extension=pdo_mysql
extension=pdo_mysql
It's worth noting that there are other versions of the PDO extension also commented out:
值得注意的是,还有其他版本的 PDO 扩展也被注释掉了:
;extension=pdo_firebird
;extension=pdo_mysql
;extension=pdo_oci
;extension=pdo_odbc
;extension=pdo_pgsql
;extension=pdo_sqlite