如何用MAMP安装mysqlnd驱动程序?

时间:2014-12-24 13:15:30

标签: php mysql mysqli mamp

我已经完成了很多在线研究,但我对此并没有太多了解,我不明白。但似乎mysql本机驱动程序没有附带MAMP堆栈。例如,mysqli get_result方法无法开箱即用。我认为这是我的安装中的一个错误,但在干净的重新安装后,该方法仍然无法正常工作,所以显然驱动程序没有安装。看起来很奇怪,这个主题的材料很少,因为很多人必须用get_result测试本地?
所以它归结为:我如何设法安装mysqlnd驱动程序? : - )

PHP.INI:

;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
;
; If you wish to have an extension loaded automatically, use the following
; syntax:
;
;   extension=modulename.extension
;
; For example, on Windows:
;
;   extension=msql.dll
;
; ... or under UNIX:
;
;   extension=msql.so
;
; Note that it should be the name of the module only; no directory information
; needs to go here.  Specify the location of the extension with the
; extension_dir directive above.


; Extensions

;extension=apcu.so

extension=imap.so
extension=yaz.so
extension=mcrypt.so
extension=gettext.so
extension=pgsql.so
extension=pdo_pgsql.so
extension=pdo_mysql.so

;extension=imagick.so
;extension=tidy.so
;extension=oauth.so

1 个答案:

答案 0 :(得分:1)

您使用的是哪个PHP版本?

在PHP 5.5中,不推荐使用MySQL原始扩展[1]。 MAMP发布应该从它的基础上删除它。

尝试使用mysqli扩展,或者应该迁移到pdo_mysql扩展名。

有一个转换器可以从mysql扩展转换为mysqli: https://wikis.oracle.com/display/mysql/Converting+to+MySQLi

[1] http://php.net/manual/en/migration55.deprecated.php

相关问题