无法在 Centos 上安装 php-mysqli 扩展
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21272748/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Cannot install php-mysqli extension on Centos
提问by user1532587
I'm trying to install mysqli extension to php
我正在尝试将 mysqli 扩展安装到 php
yum install php-mysqli
And I'm getting the next error
我收到下一个错误
...
Transaction Check Error:
file /usr/share/mysql/charsets/Index.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
file /usr/share/mysql/charsets/README from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
file /usr/share/mysql/charsets/armscii8.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
file /usr/share/mysql/charsets/ascii.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
file /usr/share/mysql/charsets/cp1250.xml from install of mysql-libs-5.1.71-1.el6.x86_64 conflicts with file from package MySQL55-server-5.5.34-2.cp1136.x86_64
file /usr/share/mysql/charsets/cp1251.xml from install of mysql-libs-5.1.71-
...
(the log continues)
(日志继续)
mysqli package is not installed as I can check with
mysqli 包未安装,因为我可以检查
php -m | grep mysqli
It returns nothing...
它什么都不返回...
回答by user1532587
Finally, I've recompiled apache using EasyApache in WHM, selecting the option MySQLi in "exhaustive options list"
最后,我在 WHM 中使用 EasyApache 重新编译了 apache,在“详尽的选项列表”中选择了 MySQLi 选项
回答by Tharange
CentOS 6.5 64 bit
CentOS 6.5 64 位
1- locate mysqli
1-定位mysqli
/usr/lib64/php/modules/mysqli.so
/usr/lib64/php/modules/mysqli.so
2- edit php.ini add
2- 编辑 php.ini 添加
extension=pathroyourfile
extension=pathroyourfile
3- restart apache
3-重启apache
回答by Daniel de coder
I finally found the answer for any one who may have the same issue with php7 and no mysqli!
我终于找到了任何可能与 php7 有相同问题但没有 mysqli 的人的答案!
- go to EasyApache 4 in whm
- then try to customize (or recompile) a new package
- choose php versions you want (u can choose multiple)
- Go to the step called "PHP EXTENSIONS"
- (THIS IS THE INTERESTING PART) search for php-mysqlnd from the top search field, it may find a couple but don't be fooled if you see one is already installed, shoose the others depending on your php versions in my case I selected all available 4 of them including this one ea-php71-php-mysqlnd.
- now the last step is to review, build or what ever it is called!
- 在 whm 中转到 EasyApache 4
- 然后尝试自定义(或重新编译)一个新包
- 选择你想要的 php 版本(你可以选择多个)
- 转到名为“PHP EXTENSIONS”的步骤
- (这是最有趣的部分)从顶部搜索字段搜索 php-mysqlnd,它可能会找到一对,但如果您看到已经安装了一个,请不要被愚弄,在我选择的情况下,根据您的 php 版本选择其他所有可用的 4 个,包括这个 ea-php71-php-mysqlnd。
- 现在最后一步是、构建或其他任何名称!
if you get update errors like this : Update Error: Error: ea-apache24-mod_cgi conflicts with ea-apache24-mod_cgid-2.4.23-2.2.2.cpanel.x86_64
如果您收到这样的更新错误:更新错误:错误:ea-apache24-mod_cgi 与 ea-apache24-mod_cgid-2.4.23-2.2.2.cpanel.x86_64 冲突
Solution : run this command from root: yum remove ea-php54-php ea-php54-php-debuginfo ea-php55-php ea-php55-php-debuginfo
解决方案:从 root 运行此命令: yum remove ea-php54-php ea-php54-php-debuginfo ea-php55-php ea-php55-php-debuginfo

