Skip to content
Advertisement

Install php8.1 and librenms on amazon linux 2 with remi’s repository

I install php8.1 following on this website

https://computingforgeeks.com/how-to-install-php-8-on-amazon-linux/

librenms on this website

https://docs.librenms.org/Installation/Installation-CentOS-7-Nginx/


And it did show the version with this command

php81 --version

but it will show “php command not found” on this command

php --version

after that I wanna install librenms and I follow the instructions on the librenms-documents and type this installation command

yum install composer cronie fping git ImageMagick jwhois mariadb mariadb-server mtr MySQL-python net-snmp net-snmp-utils nginx nmap php-fpm php-cli php-common php-curl php-gd php-mbstring php-process php-snmp php-xml php-zip php-memcached php-mysqlnd python-memcached rrdtool python3 python3-pip

the error will come out like this

Error: Package: php-pecl-memcached-3.2.0-1.el7.remi.8.1.x86_64 (remi-php81)
           Requires: php(api) = 20210902-64
           Available: php-common-5.4.16-43.amzn2.x86_64 (amzn2-core)
               php(api) = 20100412-64
           Available: php-common-5.4.16-43.amzn2.0.1.x86_64 (amzn2-core)
               php(api) = 20100412-64
           Available: php-common-5.4.16-43.amzn2.0.2.x86_64 (amzn2-core)
               php(api) = 20100412-64
           Available: php-common-5.4.16-43.amzn2.0.3.x86_64 (amzn2-core)
               php(api) = 20100412-64
           Available: php-common-5.4.16-43.amzn2.0.4.x86_64 (amzn2-core)
               php(api) = 20100412-64
           Available: php-common-5.4.16-45.amzn2.0.5.x86_64 (amzn2-core)
               php(api) = 20100412-64
           Available: php-common-5.4.16-45.amzn2.0.6.x86_64 (amzn2-core)
               php(api) = 20100412-64
           Available: php-common-5.4.16-46.amzn2.0.2.x86_64 (amzn2-core)
               php(api) = 20100412-64
           Available: php-common-8.0.0-2.amzn2.x86_64 (amzn2extra-php8.0)
               php(api) = 20200930-64
           Available: php-common-8.0.2-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(api) = 20200930-64
           Available: php-common-8.0.6-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(api) = 20200930-64
           Available: php-common-8.0.8-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(api) = 20200930-64
           Available: php-common-8.0.13-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(api) = 20200930-64
           Available: php-common-8.0.16-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(api) = 20200930-64
           Available: php-common-8.0.18-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(api) = 20200930-64
           Installing: php-common-8.0.20-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(api) = 20200930-64
Error: Package: php-pecl-igbinary-3.2.9-1.el7.remi.8.1.x86_64 (remi-php81)
           Requires: php(api) = 20210902-64
           Available: php-common-5.4.16-43.amzn2.x86_64 (amzn2-core)
               php(api) = 20100412-64
           Available: php-common-5.4.16-43.amzn2.0.1.x86_64 (amzn2-core)
               php(api) = 20100412-64
           Available: php-common-5.4.16-43.amzn2.0.2.x86_64 (amzn2-core)
               php(api) = 20100412-64
           Available: php-common-5.4.16-43.amzn2.0.3.x86_64 (amzn2-core)
               php(api) = 20100412-64
           Available: php-common-5.4.16-43.amzn2.0.4.x86_64 (amzn2-core)
               php(api) = 20100412-64
           Available: php-common-5.4.16-45.amzn2.0.5.x86_64 (amzn2-core)
               php(api) = 20100412-64
           Available: php-common-5.4.16-45.amzn2.0.6.x86_64 (amzn2-core)
               php(api) = 20100412-64
           Available: php-common-5.4.16-46.amzn2.0.2.x86_64 (amzn2-core)
               php(api) = 20100412-64
           Available: php-common-8.0.0-2.amzn2.x86_64 (amzn2extra-php8.0)
               php(api) = 20200930-64
           Available: php-common-8.0.2-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(api) = 20200930-64
           Available: php-common-8.0.6-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(api) = 20200930-64
           Available: php-common-8.0.8-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(api) = 20200930-64
           Available: php-common-8.0.13-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(api) = 20200930-64
           Available: php-common-8.0.16-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(api) = 20200930-64
           Available: php-common-8.0.18-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(api) = 20200930-64
           Installing: php-common-8.0.20-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(api) = 20200930-64
Error: Package: php-pecl-igbinary-3.2.9-1.el7.remi.8.1.x86_64 (remi-php81)
           Requires: php(zend-abi) = 20210902-64
           Available: php-common-5.4.16-43.amzn2.x86_64 (amzn2-core)
               php(zend-abi) = 20100525-64
           Available: php-common-5.4.16-43.amzn2.0.1.x86_64 (amzn2-core)
               php(zend-abi) = 20100525-64
           Available: php-common-5.4.16-43.amzn2.0.2.x86_64 (amzn2-core)
               php(zend-abi) = 20100525-64
           Available: php-common-5.4.16-43.amzn2.0.3.x86_64 (amzn2-core)
               php(zend-abi) = 20100525-64
           Available: php-common-5.4.16-43.amzn2.0.4.x86_64 (amzn2-core)
               php(zend-abi) = 20100525-64
           Available: php-common-5.4.16-45.amzn2.0.5.x86_64 (amzn2-core)
               php(zend-abi) = 20100525-64
           Available: php-common-5.4.16-45.amzn2.0.6.x86_64 (amzn2-core)
               php(zend-abi) = 20100525-64
           Available: php-common-5.4.16-46.amzn2.0.2.x86_64 (amzn2-core)
               php(zend-abi) = 20100525-64
           Available: php-common-8.0.0-2.amzn2.x86_64 (amzn2extra-php8.0)
               php(zend-abi) = 20200930-64
           Available: php-common-8.0.2-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(zend-abi) = 20200930-64
           Available: php-common-8.0.6-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(zend-abi) = 20200930-64
           Available: php-common-8.0.8-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(zend-abi) = 20200930-64
           Available: php-common-8.0.13-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(zend-abi) = 20200930-64
           Available: php-common-8.0.16-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(zend-abi) = 20200930-64
           Available: php-common-8.0.18-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(zend-abi) = 20200930-64
           Installing: php-common-8.0.20-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(zend-abi) = 20200930-64
Error: Package: php-pecl-msgpack-2.2.0~RC2-1.el7.remi.8.1.x86_64 (remi-php81)
           Requires: php(api) = 20210902-64
           Available: php-common-5.4.16-43.amzn2.x86_64 (amzn2-core)
               php(api) = 20100412-64
           Available: php-common-5.4.16-43.amzn2.0.1.x86_64 (amzn2-core)
               php(api) = 20100412-64
           Available: php-common-5.4.16-43.amzn2.0.2.x86_64 (amzn2-core)
               php(api) = 20100412-64
           Available: php-common-5.4.16-43.amzn2.0.3.x86_64 (amzn2-core)
               php(api) = 20100412-64
           Available: php-common-5.4.16-43.amzn2.0.4.x86_64 (amzn2-core)
               php(api) = 20100412-64
           Available: php-common-5.4.16-45.amzn2.0.5.x86_64 (amzn2-core)
               php(api) = 20100412-64
           Available: php-common-5.4.16-45.amzn2.0.6.x86_64 (amzn2-core)
               php(api) = 20100412-64
           Available: php-common-5.4.16-46.amzn2.0.2.x86_64 (amzn2-core)
               php(api) = 20100412-64
           Available: php-common-8.0.0-2.amzn2.x86_64 (amzn2extra-php8.0)
               php(api) = 20200930-64
           Available: php-common-8.0.2-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(api) = 20200930-64
           Available: php-common-8.0.6-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(api) = 20200930-64
           Available: php-common-8.0.8-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(api) = 20200930-64
           Available: php-common-8.0.13-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(api) = 20200930-64
           Available: php-common-8.0.16-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(api) = 20200930-64
           Available: php-common-8.0.18-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(api) = 20200930-64
           Installing: php-common-8.0.20-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(api) = 20200930-64
Error: Package: php-pecl-msgpack-2.2.0~RC2-1.el7.remi.8.1.x86_64 (remi-php81)
           Requires: php(zend-abi) = 20210902-64
           Available: php-common-5.4.16-43.amzn2.x86_64 (amzn2-core)
               php(zend-abi) = 20100525-64
           Available: php-common-5.4.16-43.amzn2.0.1.x86_64 (amzn2-core)
               php(zend-abi) = 20100525-64
           Available: php-common-5.4.16-43.amzn2.0.2.x86_64 (amzn2-core)
               php(zend-abi) = 20100525-64
           Available: php-common-5.4.16-43.amzn2.0.3.x86_64 (amzn2-core)
               php(zend-abi) = 20100525-64
           Available: php-common-5.4.16-43.amzn2.0.4.x86_64 (amzn2-core)
               php(zend-abi) = 20100525-64
           Available: php-common-5.4.16-45.amzn2.0.5.x86_64 (amzn2-core)
               php(zend-abi) = 20100525-64
           Available: php-common-5.4.16-45.amzn2.0.6.x86_64 (amzn2-core)
               php(zend-abi) = 20100525-64
           Available: php-common-5.4.16-46.amzn2.0.2.x86_64 (amzn2-core)
               php(zend-abi) = 20100525-64
           Available: php-common-8.0.0-2.amzn2.x86_64 (amzn2extra-php8.0)
               php(zend-abi) = 20200930-64
           Available: php-common-8.0.2-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(zend-abi) = 20200930-64
           Available: php-common-8.0.6-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(zend-abi) = 20200930-64
           Available: php-common-8.0.8-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(zend-abi) = 20200930-64
           Available: php-common-8.0.13-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(zend-abi) = 20200930-64
           Available: php-common-8.0.16-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(zend-abi) = 20200930-64
           Available: php-common-8.0.18-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(zend-abi) = 20200930-64
           Installing: php-common-8.0.20-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(zend-abi) = 20200930-64
Error: Package: php-pecl-memcached-3.2.0-1.el7.remi.8.1.x86_64 (remi-php81)
           Requires: php(zend-abi) = 20210902-64
           Available: php-common-5.4.16-43.amzn2.x86_64 (amzn2-core)
               php(zend-abi) = 20100525-64
           Available: php-common-5.4.16-43.amzn2.0.1.x86_64 (amzn2-core)
               php(zend-abi) = 20100525-64
           Available: php-common-5.4.16-43.amzn2.0.2.x86_64 (amzn2-core)
               php(zend-abi) = 20100525-64
           Available: php-common-5.4.16-43.amzn2.0.3.x86_64 (amzn2-core)
               php(zend-abi) = 20100525-64
           Available: php-common-5.4.16-43.amzn2.0.4.x86_64 (amzn2-core)
               php(zend-abi) = 20100525-64
           Available: php-common-5.4.16-45.amzn2.0.5.x86_64 (amzn2-core)
               php(zend-abi) = 20100525-64
           Available: php-common-5.4.16-45.amzn2.0.6.x86_64 (amzn2-core)
               php(zend-abi) = 20100525-64
           Available: php-common-5.4.16-46.amzn2.0.2.x86_64 (amzn2-core)
               php(zend-abi) = 20100525-64
           Available: php-common-8.0.0-2.amzn2.x86_64 (amzn2extra-php8.0)
               php(zend-abi) = 20200930-64
           Available: php-common-8.0.2-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(zend-abi) = 20200930-64
           Available: php-common-8.0.6-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(zend-abi) = 20200930-64
           Available: php-common-8.0.8-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(zend-abi) = 20200930-64
           Available: php-common-8.0.13-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(zend-abi) = 20200930-64
           Available: php-common-8.0.16-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(zend-abi) = 20200930-64
           Available: php-common-8.0.18-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(zend-abi) = 20200930-64
           Installing: php-common-8.0.20-1.amzn2.x86_64 (amzn2extra-php8.0)
               php(zend-abi) = 20200930-64
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest


php-fpm is available in Amazon Linux Extra topic "php7.4"

To use, run
# sudo amazon-linux-extras install php7.4

php-cli is available in Amazon Linux Extra topic "php7.4"

To use, run
# sudo amazon-linux-extras install php7.4

php-mysqlnd is available in Amazon Linux Extra topic "php7.4"

To use, run
# sudo amazon-linux-extras install php7.4

Learn more at
https://aws.amazon.com/amazon-linux-2/faqs/#Amazon_Linux_Extras

If I using the argument “–skip-broken” and install again,it will made php8.1 to php 8.0

And if I using the command below,it will also downgrade the version of php

sudo amazon-linux-extras install php7.4

I just want it to install normally and stay in the version of php8.1.

Also,want it to show the version 8.1 with the command

php --version (not php81 --version)

how could I do??

Advertisement

Answer

Don’t follow random documentation, instead follow official repository instructions from the Wizard.

It seems you have a repository priority issue between amzn and remi.

See yum documentation to set a proper priority to wanted PHP provider.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement