问题
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.
回答1:
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.
回答2:
I know this is old, but for others, make sure your /etc/yum.conf exclude= line is commented out.
来源:https://stackoverflow.com/questions/25834031/can-not-install-mysqli-in-centos