我正在尝试使用以下命令在 Amazon Linux 2 服务器上安装 php 5.4 或 5.6:
yum install php54
这是输出:
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
170 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package php54.x86_64 0:2.1-4.el7.remi will be installed
--> Processing Dependency: php54-runtime(x86-64) = 2.1-4.el7.remi for package: php54-2.1-4.el7.remi.x86_64
--> Processing Dependency: php54-php-pear >= 1:1.10 for package: php54-2.1-4.el7.remi.x86_64
--> Processing Dependency: php54-php-common(x86-64) >= 5.4.45 for package: php54-2.1-4.el7.remi.x86_64
--> Processing Dependency: php54-runtime for package: php54-2.1-4.el7.remi.x86_64
--> Processing Dependency: php54-php-cli(x86-64) for package: php54-2.1-4.el7.remi.x86_64
--> Running transaction check
---> Package php54-php-cli.x86_64 0:5.4.45-15.el7.remi will be installed
--> Processing Dependency: libtinfo.so.5()(64bit) for package: php54-php-cli-5.4.45-15.el7.remi.x86_64
--> Processing Dependency: libncurses.so.5()(64bit) for package: php54-php-cli-5.4.45-15.el7.remi.x86_64
---> Package php54-php-common.x86_64 0:5.4.45-15.el7.remi will be installed
---> Package php54-php-pear.noarch 1:1.10.6-1.el7.remi will be installed
--> Processing Dependency: php54-php-xml for package: 1:php54-php-pear-1.10.6-1.el7.remi.noarch
--> Processing Dependency: php54-php-posix for package: 1:php54-php-pear-1.10.6-1.el7.remi.noarch
---> Package php54-runtime.x86_64 0:2.1-4.el7.remi will be installed
--> Processing Dependency: environment-modules for package: php54-runtime-2.1-4.el7.remi.x86_64
--> Running transaction check
---> Package environment-modules.x86_64 0:3.2.10-0.el7.remi will be installed
--> Processing Dependency: libtcl8.5.so()(64bit) for package: environment-modules-3.2.10-0.el7.remi.x86_64
---> Package php54-php-cli.x86_64 0:5.4.45-15.el7.remi will be installed
--> Processing Dependency: libtinfo.so.5()(64bit) for package: php54-php-cli-5.4.45-15.el7.remi.x86_64
--> Processing Dependency: libncurses.so.5()(64bit) for package: php54-php-cli-5.4.45-15.el7.remi.x86_64
---> Package php54-php-process.x86_64 0:5.4.45-15.el7.remi will be installed
---> Package php54-php-xml.x86_64 0:5.4.45-15.el7.remi will be installed
--> Finished Dependency Resolution
Error: Package: environment-modules-3.2.10-0.el7.remi.x86_64 (remi-safe)
Requires: libtcl8.5.so()(64bit)
Error: Package: php54-php-cli-5.4.45-15.el7.remi.x86_64 (remi-safe)
Requires: libncurses.so.5()(64bit)
Error: Package: php54-php-cli-5.4.45-15.el7.remi.x86_64 (remi-safe)
Requires: libtinfo.so.5()(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
输出表明它知道哪些包包含错误提到的依赖项,但它没有安装它们。
我之前已经安装了 epel 和 remi 存储库,因为 amazon-linux-extras 没有低于 7.1 的 php 版本。
当我执行:
yum list installed | grep "php"
我没有得到结果,所以我不认为与现有包存在冲突。
我也尝试过:
yum install php54 --disablerepo="*" --enablerepo="remi"
以确保没有存储库冲突。
编辑:我也尝试了该命令的其他版本:
yum install php70
yum install php71
yum install php72
并且他们都对相同的“lib*”要求犯了类似的错误。
知道为什么会发生这种情况以及如何解决这个问题吗?
答案1
我在进行故障排除时删除了查找 lib* 依赖项所需的 amazon repo,并强制 yum 选择 remi repo。将其重新添加后,命令就可以正常工作了。
但是,现在我必须弄清楚如何配置 php,因为那些包没有创建一个在卸载 amazon 的 php7.1 时被删除的 php.ini 文件。