试图在ec2上安装php-mbstring的依赖问题

Bob*_*Lin 33 php dependencies amazon-ec2 mbstring yii2

我正在尝试yii2在我的Amazon Linux AMI实例上安装,它需要php-mbstring扩展才能工作.

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

错误:php56-与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
Run Code Online (Sandbox Code Playgroud)

感谢您提前的时间

Ale*_*rei 80

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

sudo yum install php56-mbstring

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

  • 我不得不重启服务器以启动mbstring."sudo service httpd restart` (3认同)
  • 如果你使用PHP 7`sudo yum install php70-mbstring` (3认同)