yum install php dependency errors

1

I'm trying to install php 5.4 or 5.6 on an Amazon Linux 2 server using this command:

yum install php54

This is the output:

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

The output suggests that it knows which packages contain the dependencies that the errors mention, yet it doesn't install them.

I've previously installed the epel and remi repositories, since amazon-linux-extras does not have php version lower than 7.1.

When I execute:

yum list installed | grep "php"

I get not results, so I don't think there's a conflict with existing packages.

I also tried:

yum install php54 --disablerepo="*" --enablerepo="remi"

to make sure that there are no repository conflicts.

EDIT: I've also tried other versions of the command:

yum install php70
yum install php71
yum install php72

And they all had similar errors regarding the same "lib*" requirements.

Any idea why this is happening and how to fix this?

Cohaven

Posted 2018-11-06T18:38:16.027

Reputation: 11

Why are you installing version 5.4 when the current version is 7.2.11? You should maybe take a look at this tutorial.

– harrymc – 2018-11-06T18:58:47.343

I did follow this tutorial the first time around, thinking that upgrading from 5.3 to 7.1 wouldn't be a problem, however, one of our website libraries needs a php version of under 7.0 to run. Upgrading this library will take more work than I can spare right now, as a lot of code will need to be modified, so I will have to come back to upgrading to php version 7 in the near future. – Cohaven – 2018-11-06T19:14:34.133

I guess you are running into dependency issues because this old version needs old libraries. Better verify if these old versions exist in the repository, and if they won't conflict with already installed versions. – harrymc – 2018-11-06T19:17:20.180

Answers

0

I removed an amazon repo that was needed to find the lib* dependencies when I was troubleshooting and forcing yum to select the remi repo. After adding it back in, the command worked.

However, now I have to figure out how to configure php, as those packages didn't create a php.ini file that was deleted when I uninstalled amazon's php7.1.

Cohaven

Posted 2018-11-06T18:38:16.027

Reputation: 11