无法在Centos中安装mysqli [英] Can not install mysqli in Centos
问题描述
我无法安装Mysqli.
我正在使用Centos 6,apache 2.2.x和php 5.4 MySql 5.5.37-cll
我尝试过:
yum install php-pdo php-mysqli
我看到:
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.clouvider.net
* elrepo: mirrors.coreix.net
* extras: centos.hyve.com
* updates: mirrors.coreix.net
Setting up Install Process
No package php-pdo available.
No package php-mysqli available.
Error: Nothing to do
我尝试过:
yum install php-mysqli
我看到了:
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.openitc.uk
* elrepo: mirrors.coreix.net
* extras: centos.hyve.com
* updates: mirrors.coreix.net
Setting up Install Process
No package php-mysqli available.
在我的php.ini中的动态扩展"部分中,我没有安装任何模块(我认为).如果我错了,请纠正我. 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.
;Windows Extensions
;Note that MySQL and ODBC support is now built in, so no dll is needed for it.
;
;extension=php_bz2.dll
;extension=php_cpdf.dll
;extension=php_crack.dll
;extension=php_curl.dll
;extension=php_db.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_dbx.dll
;extension=php_domxml.dll
;extension=php_exif.dll
;extension=php_fdf.dll
;extension=php_filepro.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_hyperwave.dll
;extension=php_iconv.dll
;extension=php_ifx.dll
;extension=php_iisfunc.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_java.dll
;extension=php_ldap.dll
;extension=php_mbstring.dll
;extension=php_mcrypt.dll
;extension=php_mhash.dll
;extension=php_mime_magic.dll
;extension=php_ming.dll
;extension=php_mssql.dll
;extension=php_msql.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_oracle.dll
;extension=php_pdf.dll
;extension=php_pgsql.dll
;extension=php_printer.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_sockets.dll
;extension=php_sybase_ct.dll
;extension=php_w32api.dll
;extension=php_xmlrpc.dll
;extension=php_xslt.dll
;extension=php_yaz.dll
;extension=php_zip.dll
顺便说一句,以上所有模块都是针对Windows的,我是否需要为Centos编辑/激活任何模块?我需要与数据库的mysql和mysqli连接.
更新
我用easyapache重建了Apache,并检查了mysqli扩展名.我将发布结果.
从上面发布的结果来看,它没有安装,因为它无法在服务器上配置的任何存储库中找到php-pdo软件包.似乎您已对存储库进行了更改,因为elrepo
既不在我已安装的版本5发行版中也不在版本6中.
我建议您先列出这些存储库中可用的软件包,因为它们可能是以不同的名称打包的.运行yum list php*
以查看php软件包的输出.然后百胜会告诉您哪些可用,已安装以及需要更新.
注意:如果您在共享主机上,则可能已经安装了PHP并将其映射到特定版本.通常,您会在软件包名称中看到版本号,因此php可能是php4安装,php5可能是php版本5.2及以下安装,php53可能是php版本5.3安装,是的,我什至看到映射到php版本5.3的php6软件包.因此,如果您的服务器上安装的PHP软件包的软件包名称中包含版本号,这并不会与众不同.确实取决于您要使用的存储库.
I can not install the Mysqli.
I am using Centos 6 , apache 2.2.x and php 5.4 MySql 5.5.37-cll
I tried:
yum install php-pdo php-mysqli
and I see:
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.clouvider.net
* elrepo: mirrors.coreix.net
* extras: centos.hyve.com
* updates: mirrors.coreix.net
Setting up Install Process
No package php-pdo available.
No package php-mysqli available.
Error: Nothing to do
I tried :
yum install php-mysqli
and I see :
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.openitc.uk
* elrepo: mirrors.coreix.net
* extras: centos.hyve.com
* updates: mirrors.coreix.net
Setting up Install Process
No package php-mysqli available.
In my php.ini in section Dynamic Extensions I have none module installed ( i think. ) Correct me if I am wrong. php.ini - > Dynamic Extensions
;;;;;;;;;;;;;;;;;;;;;;
; 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.
;Windows Extensions
;Note that MySQL and ODBC support is now built in, so no dll is needed for it.
;
;extension=php_bz2.dll
;extension=php_cpdf.dll
;extension=php_crack.dll
;extension=php_curl.dll
;extension=php_db.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_dbx.dll
;extension=php_domxml.dll
;extension=php_exif.dll
;extension=php_fdf.dll
;extension=php_filepro.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_hyperwave.dll
;extension=php_iconv.dll
;extension=php_ifx.dll
;extension=php_iisfunc.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_java.dll
;extension=php_ldap.dll
;extension=php_mbstring.dll
;extension=php_mcrypt.dll
;extension=php_mhash.dll
;extension=php_mime_magic.dll
;extension=php_ming.dll
;extension=php_mssql.dll
;extension=php_msql.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_oracle.dll
;extension=php_pdf.dll
;extension=php_pgsql.dll
;extension=php_printer.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_sockets.dll
;extension=php_sybase_ct.dll
;extension=php_w32api.dll
;extension=php_xmlrpc.dll
;extension=php_xslt.dll
;extension=php_yaz.dll
;extension=php_zip.dll
By the way, all the above module is for windows, Should I need to edit/activate any module for the Centos? I need mysql and mysqli connections to database.
Update
I rebuild the apache with easyapache and I check the mysqli extension. I'll post the results from that.
From the results you posted above, it's not installing because it can't find the php-pdo package in any of the repositories configured on your server. It looks like you have made changes to your repositories as elrepo
is not in either the version 5 or 6 distributions that I have installed.
I would suggest you first list the packages availabe in these repositories as they may be packaged under a different name. Run yum list php*
to see an output of php packages. Yum will then tell you what is available, installed, and needs updating.
Note: If you're on a shared host, chances are that PHP is already installed and mapped to a specific version. Often times, you'll see the version number in the package name, so php might be a php4 install, php5 might be a php version 5.2 and below install, php53 might be a php version 5.3 install, and yes I've even seen a php6 package mapped to php version 5.3. So it wouldn't be out of the ordinary if the PHP package installed on YOUR server includes a version number in the package name. Really depends on what repositories you're setup to use.
这篇关于无法在Centos中安装mysqli的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!