无法在PHP7上安装php-mysqli

我已经安装了 PHP 7,MysqL5.7,Apache2.2,CentOS6.

我正在安装CodeIgniter3.0.6.

当我使用数据库连接时,
发生错误并说

A PHP Error was encountered

Severity: Core Warning

Message: PHP Startup: Unable to load dynamic library '/usr/lib64/PHP/modules/PHP_MysqLi.so' - /usr/lib64/PHP/modules/PHP_MysqLi.so: cannot open shared object file: No such file or directory

Filename: UnkNown

Line Number: 0

当然’/usr/lib64/PHP/modules/PHP_MysqLi.so’中没有文件,但我不知道如何安装MysqLi.so.

我试过了

yum install PHP-MysqL

Loaded plugins: fastestmirror,security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * epel: ftp.riken.jp
 * extras: ftp.iij.ad.jp
 * remi-safe: mirror.awanti.com
 * updates: ftp.iij.ad.jp
Resolving Dependencies
--> Running transaction check
---> Package PHP-MysqL.x86_64 0:5.3.3-46.el6_7.1 will be installed
--> Processing Dependency: PHP-common(x86-64) = 5.3.3-46.el6_7.1 for package: PHP-MysqL-5.3.3-46.el6_7.1.x86_64
--> Finished Dependency Resolution
Error: Package: PHP-MysqL-5.3.3-46.el6_7.1.x86_64 (updates)
           Requires: PHP-common(x86-64) = 5.3.3-46.el6_7.1
           Installed: PHP-common-7.0.4-1.el6.remi.x86_64 (@remi-PHP70)
               PHP-common(x86-64) = 7.0.4-1.el6.remi
           Available: PHP-common-5.3.3-40.el6_6.x86_64 (base)
               PHP-common(x86-64) = 5.3.3-40.el6_6
           Available: PHP-common-5.3.3-46.el6_6.x86_64 (updates)
               PHP-common(x86-64) = 5.3.3-46.el6_6
           Available: PHP-common-5.3.3-46.el6_7.1.x86_64 (updates)
               PHP-common(x86-64) = 5.3.3-46.el6_7.1
 You Could try using --skip-broken to work around the problem
 You Could try running: rpm -Va --nofiles --nodigest

它不起作用.

当我执行yum install PHP7.0-MysqL或yum install PHP70w-MySQL命令时,

Loaded plugins: fastestmirror,security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * epel: ftp.riken.jp
 * extras: ftp.iij.ad.jp
 * remi-safe: mirror.awanti.com
 * updates: ftp.iij.ad.jp
No package PHP7.0-MysqL available.
Error: nothing to do

我根本不知道该怎么做.

请注意0​​7000扩展名为 deprecated,并且不再存在PHP 7.

PHP-MysqLnd包仅提供mysqlipdo_mysql扩展.

PHP-pecl-MysqL也可用,从git快照构建,提供与旧版应用程序的兼容性,但不受支持.

从最初的问题:

Installed: PHP-common-7.0.4-1.el6.remi.x86_64 (@remi-PHP70)

您从remi-PHP70安装了PHP 7.0.4,但未启用存储库.您需要启用它,因此yum将找到与已安装版本匹配的正确软件包.

Configuration Wizard指令:

yum install yum-utils
yum-config-manager --enable remi-PHP70
yum install PHP-MysqLnd

注意:安装“foo”扩展名的正确命令是yum install PHP-foo,所以“yum install PHP-MysqL”将安装提供MysqL扩展的包(所以PHP-pecl-MysqL),“yum install PHP- MysqLi“将安装提供MysqLi扩展的包(所以PHP-MysqLnd).

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...