【问题标题】:Dependency issue trying to install php-mbstring on ec2尝试在 ec2 上安装 php-mbstring 的依赖问题
【发布时间】:2015-09-20 08:03:18
【问题描述】:

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

当我尝试运行 sudo yum install php-mbstring 时,它返回了这个错误:

错误: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

提前感谢您的宝贵时间

【问题讨论】:

  • 5.5 和 5.3?... 和 5.6?你找不到匹配版本的包吗?
  • 在 Amazon Linux 上,5.4 及更高版本的 PHP 版本设置为并行运行。使用替代设置来设置活动版本。

标签: php amazon-ec2 dependencies yii2 mbstring


【解决方案1】:

Amazon Linux AMI 版本 2017.09

sudo yum install php70-mysqlnd
sudo service httpd restart

【讨论】:

    【解决方案2】:

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

    运行sudo yum install php56-mbstring

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

    【讨论】:

    • 其他可能有帮助的命令。 yum search, yum list installed, man yum.
    • 我必须重新启动服务器才能启动 mbstring。sudo service httpd restart
    • 如果您使用的是 PHP 7 sudo yum install php70-mbstring
    • 如果您使用的是 PHP 7.2 sudo yum install php72-mbstring
    猜你喜欢
    • 1970-01-01
    • 2016-07-26
    • 2021-10-03
    • 2014-10-18
    • 2021-07-02
    • 2023-03-31
    • 1970-01-01
    • 2021-06-01
    • 2020-09-29
    相关资源
    最近更新 更多