Cannot Find php-fpm for PHP 7.2 on CentOS 7.5 – Installation Guide

centos7PHPphp-fpmphp7yum

Have created a new VM server for a project, it is running Centos 7.5. After following a large number of different articles online to try and get nginx and PHP 7.2 running on this box I cannot get the correct version of PHP or the PHP-FPM module to install.

I ran the following command:

yum install php php-common php-opcache php-mcrypt php-cli php-gd php-curl php-mysql php-fpm

The result was as below

Dependencies Resolved

Package                Arch     Version                 Repository        Size

Installing:
  php                    x86_64   5.4.16-45.el7           centos           1.4 M
  php-cli                x86_64   5.4.16-45.el7           centos           2.7 M
  php-common             x86_64   5.4.16-45.el7           centos           565 k
  php-fpm                x86_64   5.4.16-45.el7           centos           1.4 M
  php-gd                 x86_64   5.4.16-45.el7           centos           128 k
  php-mcrypt             x86_64   5.4.16-7.el7            epel_mirror       20 k
  php-mysql              x86_64   5.4.16-45.el7           centos           101 k
  php-pecl-zendopcache   x86_64   7.0.5-2.el7             epel_mirror       74 k
Installing for dependencies:
  httpd                  x86_64   2.4.6-80.el7.centos.1   centos-updates   2.7 M
  httpd-tools            x86_64   2.4.6-80.el7.centos.1   centos-updates    90 k
  libmcrypt              x86_64   2.5.8-13.el7            epel_mirror       99 k
  libzip                 x86_64   0.10.1-8.el7            centos            48 k
  php-pdo                x86_64   5.4.16-45.el7           centos            99 k
  php-pear               noarch   1:1.9.4-21.el7          centos           357 k
  php-process            x86_64   5.4.16-45.el7           centos            56 k
  php-xml                x86_64   5.4.16-45.el7           centos           126 k
  t1lib                  x86_64   5.1.2-14.el7            centos           166 k

I am really struggling to get my head round why this is not working – any and all help appreciated.

If more information is needed then please just ask 🙂
t2t

Update

The most recent article I tried to follow was: https://www.if-not-true-then-false.com/2011/install-nginx-php-fpm-on-fedora-centos-red-hat-rhel/

Executing the install command there:

yum --enablerepo=remi,remi-php72 install nginx php-fpm php-common

Result (truncated to show PHP versions):

php-common     x86_64        5.4.16-45.el7       centos                               565 k
php-fpm        x86_64        5.4.16-45.el7       centos                               1.4 M

Full Info

As requested in comments below…

$ sudo -i
[sudo] password for youngm: 
# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-rele ase-latest-7.noarch.rpm
Retrieving https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Preparing... 
    package epel-release-7-11.noarch is already installed
# 
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
Retrieving http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
Preparing... 
    package remi-release-7.5-2.el7.remi.noarch is already installed
# yum --enablerepo=remi,remi-php72 install nginx php-fpm php-common
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile

centos                                                                                                                                                                                                                | 2.1 kB  00:00:00     

epel_mirror                                                                                                                                                                                                           | 2.1 kB  00:00:00     
639 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package nginx.x86_64 1:1.12.2-2.el7 will be installed
--> Processing Dependency: nginx-filesystem = 1:1.12.2-2.el7 for package: 1:nginx-1.12.2-2.el7.x86_64
--> Processing Dependency: nginx-all-modules = 1:1.12.2-2.el7 for package: 1:nginx-1.12.2-2.el7.x86_64
--> Processing Dependency: nginx-filesystem for package: 1:nginx-1.12.2-2.el7.x86_64
---> Package php-common.x86_64 0:5.4.16-45.el7 will be installed
--> Processing Dependency: libzip.so.2()(64bit) for package: php-common-5.4.16-45.el7.x86_64
---> Package php-fpm.x86_64 0:5.4.16-45.el7 will be installed
--> Running transaction check
---> Package libzip.x86_64 0:0.10.1-8.el7 will be installed
---> Package nginx-all-modules.noarch 1:1.12.2-2.el7 will be installed
--> Processing Dependency: nginx-mod-stream = 1:1.12.2-2.el7 for package: 1:nginx-all-modules-1.12.2-2.el7.noarch
--> Processing Dependency: nginx-mod-mail = 1:1.12.2-2.el7 for package: 1:nginx-all-modules-1.12.2-2.el7.noarch
--> Processing Dependency: nginx-mod-http-xslt-filter = 1:1.12.2-2.el7 for package: 1:nginx-all-modules-1.12.2-2.el7.noarch
--> Processing Dependency: nginx-mod-http-perl = 1:1.12.2-2.el7 for package: 1:nginx-all-modules-1.12.2-2.el7.noarch
--> Processing Dependency: nginx-mod-http-image-filter = 1:1.12.2-2.el7 for package: 1:nginx-all-modules-1.12.2-2.el7.noarch
--> Processing Dependency: nginx-mod-http-geoip = 1:1.12.2-2.el7 for package: 1:nginx-all-modules-1.12.2-2.el7.noarch
---> Package nginx-filesystem.noarch 1:1.12.2-2.el7 will be installed
--> Running transaction check
---> Package nginx-mod-http-geoip.x86_64 1:1.12.2-2.el7 will be installed
---> Package nginx-mod-http-image-filter.x86_64 1:1.12.2-2.el7 will be installed
---> Package nginx-mod-http-perl.x86_64 1:1.12.2-2.el7 will be installed
---> Package nginx-mod-http-xslt-filter.x86_64 1:1.12.2-2.el7 will be installed
---> Package nginx-mod-mail.x86_64 1:1.12.2-2.el7 will be installed
---> Package nginx-mod-stream.x86_64 1:1.12.2-2.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================================================================================================
 Package                                                               Arch                                             Version                                                  Repository                                             Size
=============================================================================================================================================================================================================================================
Installing:
 nginx                                                                 x86_64                                           1:1.12.2-2.el7                                           epel_mirror                                           530 k
 php-common                                                            x86_64                                           5.4.16-45.el7                                            centos                                                565 k
 php-fpm                                                               x86_64                                           5.4.16-45.el7                                            centos                                                1.4 M
Installing for dependencies:
 libzip                                                                x86_64                                           0.10.1-8.el7                                             centos                                                 48 k
 nginx-all-modules                                                     noarch                                           1:1.12.2-2.el7                                           epel_mirror                                            16 k
 nginx-filesystem                                                      noarch                                           1:1.12.2-2.el7                                           epel_mirror                                            17 k
 nginx-mod-http-geoip                                                  x86_64                                           1:1.12.2-2.el7                                           epel_mirror                                            23 k
 nginx-mod-http-image-filter                                           x86_64                                           1:1.12.2-2.el7                                           epel_mirror                                            26 k
 nginx-mod-http-perl                                                   x86_64                                           1:1.12.2-2.el7                                           epel_mirror                                            36 k
 nginx-mod-http-xslt-filter                                            x86_64                                           1:1.12.2-2.el7                                           epel_mirror                                            26 k
 nginx-mod-mail                                                        x86_64                                           1:1.12.2-2.el7                                           epel_mirror                                            54 k
 nginx-mod-stream                                                      x86_64                                           1:1.12.2-2.el7                                           epel_mirror                                            76 k

Transaction Summary
=============================================================================================================================================================================================================================================
Install  3 Packages (+9 Dependent packages)

Total download size: 2.8 M
Installed size: 10 M
Is this ok [y/d/N]: n
Exiting on user command
Your transaction was saved, rerun it with:
 yum load-transaction /tmp/yum_save_tx.2018-11-13.14-37.LmQUgX.yumtx
# 

Best Answer

Here is your problem:

639 packages excluded due to repository priority protections

You or someone else has explicitly excluded packages from being installed on your system by setting priorities in /etc/yum.conf or in individual repo files in /etc/yum.repos.d directory.

Check all of these files for lines that read priority=### where ### is a number, and delete any that you find. Then try installing packages again.

To ensure this doesn't happen again, you should also remove the offending yum plugin with something like yum remove yum-plugin-priorities.

Related Topic