无法在PHP7上安装php-mysqli

前端之家收集整理的这篇文章主要介绍了无法在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).

原文链接:https://www.f2er.com/php/138135.html

猜你在找的PHP相关文章