尝试在 ec2 上安装 php-mbstring 的依赖问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31190547/
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
Dependency issue trying to install php-mbstring on ec2
提问by Bob Lin
I am trying to install yii2
on my Amazon Linux AMI instance, it requires the php-mbstring
extension to work.
我正在尝试yii2
在我的 Amazon Linux AMI 实例上安装,它需要php-mbstring
扩展才能工作。
When I tried to run sudo yum install php-mbstring
it returned this error:
当我尝试运行sudo yum install php-mbstring
它时返回此错误:
Error: php56-common conflicts with php-common-5.3.29-1.8.amzn1.x86_64
错误:php56-common 与 php-common-5.3.29-1.8.amzn1.x86_64 冲突
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main/latest | 2.1 kB 00:00
amzn-updates/latest | 2.3 kB 00:00
2494 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package php-mbstring.x86_64 0:5.3.29-1.8.amzn1 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.29-1.8.amzn1 for package: php-mbstring-5.3.29-1.8.amzn1.x86_64
--> Running transaction check
---> Package php-common.x86_64 0:5.3.29-1.8.amzn1 will be installed
--> Processing Conflict: php56-common-5.6.9-1.112.amzn1.x86_64 conflicts php-common < 5.5.22-1.98
--> Finished Dependency Resolution
Error: php56-common conflicts with php-common-5.3.29-1.8.amzn1.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
Thanks for your time in advance
感谢您提前抽出时间
回答by Alex Andrei
It seems you have php 5.6 installed.
You need to install mbstring
for that particular version of php
.
您似乎安装了 php 5.6。
您需要mbstring
为该特定版本安装php
.
Run sudo yum install php56-mbstring
跑 sudo yum install php56-mbstring
After that it might be a good idea to restart apache (thanks! @hexicle),
using sudo service httpd restart
之后,重新启动 apache 可能是个好主意(谢谢!@hexicle),
使用sudo service httpd restart
回答by Victorio Berra
Amazon Linux AMI release 2017.09
亚马逊 Linux AMI 发布 2017.09
sudo yum install php70-mysqlnd
sudo service httpd restart