douzhaiyuan1731 2015-06-03 04:02
浏览 221
已采纳

我怎么知道安装了什么版本的mysqli?

I'm putting together some documentation for developers and I want to include the required PHP extensions and versions of each. For instance, one requirement is gd 2.1.1 and another is phalcon 2.0.1.

I know how to figure out what versions of PHP and MySQL are installed, but I can't figure out what version of the mysqli extension I have. phpinfo shows the following information under the mysqli extension section:

MysqlI Support  enabled
Client API library version  5.5.43
Active Persistent Links 0
Inactive Persistent Links   0
Active Links    0
Client API header version   5.5.41
MYSQLI_SOCKET   /var/run/mysqld/mysqld.sock

I think this just tells me that the version of MySQL I have installed is 5.5.43, which I assume is different from the version of mysqli.

dpkg shows the version of php5-msyql is 5.5.9+dfsg-1ubuntu4 (I think there's a .9 that's truncated), which I believe is the version of the metapackage and not necessarily the version of the extension:

$ dpkg -l php5-mysql
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                          Version             Architecture        Description
+++-=============================-===================-===================-================================================================
ii  php5-mysql                    5.5.9+dfsg-1ubuntu4 amd64               MySQL module for php5
  • 写回答

2条回答 默认 最新

  • doujian3132 2015-06-03 04:11
    关注

    You can try below: http://php.net/manual/en/reflectionextension.getversion.php

    $ext = new ReflectionExtension('mysqli');
    var_dump($ext->getVersion());
    // Output: string(3) "0.1"
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型