Ryo*_*han 11 php mysqli centos
我已经安装了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
Run Code Online (Sandbox Code Playgroud)
当然'/usr/lib64/php/modules/php_mysqli.so'中没有文件,但我不知道如何安装mysqli.so.
我试过了
yum install php-mysql
Run Code Online (Sandbox Code Playgroud)
但
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
Run Code Online (Sandbox Code Playgroud)
它不起作用.
当我执行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
Run Code Online (Sandbox Code Playgroud)
我根本不知道该怎么做.
Fed*_*kun 12
对于PHP7,在CentOS/RHEL上:
yum install php70w-mysql
Run Code Online (Sandbox Code Playgroud)
如果您使用Remi存储库
yum install php70-php-mysqlnd
Run Code Online (Sandbox Code Playgroud)
对于Ubuntu:
apt-get install php7.0-mysql
Run Code Online (Sandbox Code Playgroud)
的PHP-mysqlnd包仅提供的mysqli和PDO_MYSQL扩展.
在PHP的PECL-mysql的也可以,从git的快照,提供对旧有应用程序的兼容性建立,但不支持.
从原来的问题:
安装:php-common-7.0.4-1.el6.remi.x86_64(@ remi-php70)
您从remi-php70安装了php 7.0.4 ,但未启用存储库.您需要启用它,因此yum将找到与已安装版本匹配的正确软件包.
从配置向导说明:
yum install yum-utils
yum-config-manager --enable remi-php70
yum install php-mysqlnd
Run Code Online (Sandbox Code Playgroud)
注意:安装"foo"扩展名的正确命令是yum install php-foo,所以"yum install php-mysql"将安装提供mysql扩展的包(所以php-pecl-mysql),"yum install php- mysqli"将安装提供mysqli扩展的包(所以php-mysqlnd).