2015-07-02 60 views
25

我试图在我的Amazon Linux AMI实例上安装yii2,它需要php-mbstring扩展才能工作。尝试在ec2上安装php-mbstring的依赖关系问题

当我试图运行sudo yum install php-mbstring它返回此错误:

Error: php56-common conflicts with 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 

感谢您的时间提前

+0

5.5和5.3? ...和5.6?你能找到匹配版本的软件包吗? – ficuscr

+0

在亚马逊Linux上,5.4版及以后的PHP版本设置为并排运行。使用替代方法设置活动版本。 – datasage

回答

65

看来你已经安装了PHP 5.6。
您需要为该特定版本的php安装mbstring

运行sudo yum install php56-mbstring

之后,它可能会重新启动Apache是​​一个好主意(感谢!@hexicle),
使用sudo service httpd restart

+0

其他可能有帮助的命令。 'yum search','yum list installed','man yum'。 – ficuscr

+0

nope,那个应该这样做:)) –

+4

谢谢我是个笨蛋 –

0

亚马逊的Linux AMI释放2017.09

sudo yum install php70-mysqlnd 
sudo service httpd restart