如何使用MAMP安装mysqlnd驱动程序? [英] How to install the mysqlnd driver with MAMP?

查看:73
本文介绍了如何使用MAMP安装mysqlnd驱动程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经做了很多在线研究,但是我对此并没有太多了解,我不理解.但似乎mysql本机驱动程序不随MAMP堆栈一起提供.例如,mysqli get_result方法不能立即使用.我以为这是我的安装中的错误,但是在重新安装之后,该方法仍然不起作用,因此显然未安装驱动程序.关于该主题的材料很少,似乎很奇怪,因为很多人必须使用get_result测试本地内容?
所以可以归结为:我如何管理mysqlnd驱动程序的安装? :-)

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. For instance the mysqli get_result method doesn't work out of the box. 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?
So it comes down to this: how do i manage to install the mysqlnd driver? :-)

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

推荐答案

您正在使用哪个PHP版本?

Which PHP version are you using ?

在PHP 5.5中,不推荐使用MySQL原始扩展名[1]. MAMP发行版应将其从其基础中删除.

In PHP 5.5 the MySQL original extension was deprecated [1]. MAMP distribution should deleted it from it's base.

尝试使用mysqli扩展名,否则您应该迁移到pdo_mysql扩展名.

Try to use mysqli extension, or you should migrate to pdo_mysql extension.

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

There it's a converter to change from mysql extension to mysqli one: https://wikis.oracle.com/display/mysql/Converting+to+MySQLi

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

这篇关于如何使用MAMP安装mysqlnd驱动程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆