简体   繁体   English

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

[英]How to install the mysqlnd driver with MAMP?

Ive done a lot of online research, but I haven't found much on this, which I dont understand. 我已经完成了很多在线研究,但我没有找到太多关于此的内容,我不明白。 But it seems that the mysql native driver doesn't come with the MAMP stack. 但似乎mysql本机驱动程序没有附带MAMP堆栈。 For instance the mysqli get_result method doesn't work out of the box. 例如,mysqli get_result方法无法开箱即用。 I thought this was an error in my installation but after a clean reinstall the method still doesn't work, so apparently the driver is not install. 我认为这是我的安装中的一个错误,但在干净的重新安装后,该方法仍然无法正常工作,所以显然驱动程序没有安装。 It seems weird that there is so little material on the topic because a lot of people must be testing local with get_result? 看起来很奇怪,这个主题的材料很少,因为很多人必须用get_result测试本地?
So it comes down to this: how do i manage to install the mysqlnd driver? 所以它归结为:我如何设法安装mysqlnd驱动程序? :-) :-)

PHP.INI: 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

Which PHP version are you using ? 您使用的是哪个PHP版本?

In PHP 5.5 the MySQL original extension was deprecated [1]. 在PHP 5.5中,MySQL原始扩展已被弃用[1]。 MAMP distribution should deleted it from it's base. MAMP发布应该从它的基础上删除它。

Try to use mysqli extension, or you should migrate to pdo_mysql extension. 尝试使用mysqli扩展,或者您应该迁移到pdo_mysql扩展。

There it's a converter to change from mysql extension to mysqli one: https://wikis.oracle.com/display/mysql/Converting+to+MySQLi 它是一个转换器,可以从mysql扩展转换为mysqli: https//wikis.oracle.com/display/mysql/Converting+to+MySQLi

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM