I am trying to install PHP7.1 on my RHEL7 server and I am unable to get the repository where it exists to attach.

From various redhat support articles I have been following don't seem to do the trick.

[root@nj-way-intranet:~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.4 (Maipo)
[root@nj-way-intranet:~]# subscription-manager repos --enable rhel-server-rhscl-7-beta-rpms
Error: 'rhel-server-rhscl-7-beta-rpms' does not match a valid repository ID. Use "subscription-manager repos --list" to see valid repositories.
[root@nj-way-intranet:~]# subscription-manager repos --list | egrep rhscl
[root@nj-way-intranet:~]# subscription-manager repos --enable rhel-7-server-extras-rpms
Repository 'rhel-7-server-extras-rpms' is enabled for this system.
[root@nj-way-intranet:~]# subscription-manager repos --enable rhel-7-server-optional-rpms
Repository 'rhel-7-server-optional-rpms' is enabled for this system.
[root@nj-way-intranet:~]# subscription-manager repos --enable rhel-server-    rhscl-7-rpms
Error: 'rhel-server-rhscl-7-rpms' does not match a valid repository ID. Use "subscription-manager repos --list" to see valid repositories.

[root@nj-way-intranet:~]# subscription-manager list

Installed Product Status
Product Name:   Red Hat Enterprise Linux Server
Product ID:     69
Version:        7.4
Arch:           x86_64
Status:         Subscribed
Status Details:
Starts:         12/20/2017
Ends:           12/19/2018

Any help is greatly appreciated.

I added a pastebin with the output of the repos I have as it is pretty extensive:


added pastebin of repo list

  • rhel-7-server-eus-thirdparty-oracle-java-isos
    • rhel-7-server-eus-supplementary-isos
    • rhel-7-server-eus-source-isos
    • rhel-7-server-eus-isos
    • rhel-sap-hana-for-rhel-7-server-eus-debug-rpms
    • rhel-sap-hana-for-rhel-7-server-eus-rpms
    • rhel-sap-hana-for-rhel-7-server-eus-source-rpms
    • rhel-sjis-for-rhel-7-server-eus-debug-rpms
    • rhel-sjis-for-rhel-7-server-eus-rpms
    • rhel-sjis-for-rhel-7-server-eus-source-rpms
    • rhel-7-server-eus-thirdparty-oracle-java-source-rpms
    • rhel-7-server-eus-thirdparty-oracle-java-rpms
    • rhel-rs-for-rhel-7-server-eus-debug-rpms
    • rhel-rs-for-rhel-7-server-eus-rpms
    • rhel-rs-for-rhel-7-server-eus-source-rpms
    • rhel-ha-for-rhel-7-server-eus-rpms
    • rhel-ha-for-rhel-7-server-eus-source-rpms
    • rhel-ha-for-rhel-7-server-eus-debug-rpms
    • rhel-7-server-eus-rpms
    • rhel-7-server-eus-rh-common-source-rpms
    • rhel-7-server-eus-supplementary-debuginfo
    • rhel-7-server-eus-satellite-tools-6.2-source-rpms
    • rhel-7-server-eus-optional-rpms
    • rhel-7-server-eus-rh-common-rpms
    • rhel-7-server-eus-supplementary-source-rpms
    • rhel-7-server-eus-debug-rpms
    • rhel-7-server-eus-satellite-tools-6.2-debug-rpms
    • rhel-7-server-eus-source-rpms
    • rhel-7-server-eus-supplementary-rpms
    • rhel-7-server-eus-rh-common-debug-rpms
    • rhel-7-server-eus-optional-debug-rpms
    • rhel-7-server-eus-rhn-tools-debug-rpms
    • rhel-7-server-eus-rhn-tools-rpms
    • rhel-7-server-eus-rhn-tools-source-rpms
    • rhel-7-server-eus-optional-source-rpms
    • rhel-7-server-eus-satellite-tools-6.1-source-rpms
    • rhel-7-server-eus-satellite-tools-6.1-debug-rpms
    • rhel-7-server-eus-satellite-tools-6.1-rpms
    • rhel-7-server-eus-satellite-tools-6.2-rpms
    • rhel-sap-for-rhel-7-server-eus-rpms
    • rhel-sap-for-rhel-7-server-eus-source-rpms
    • rhel-sap-for-rhel-7-server-eus-debug-rpms

The correct name of the repo is rhel-server-rhscl-7-rpms. You seem to have some sort of nonprinting or whitespace character embedded in the middle of your command line. Try copying and pasting.

Repo ID:   rhel-server-rhscl-7-rpms
Repo Name: Red Hat Software Collections RPMs for Red Hat Enterprise Linux 7 Server
Repo URL:  https://cdn.redhat.com/content/dist/rhel/server/7/$releasever/$basearch/rhscl/1/os
Enabled:   0
  • The space above was an unfortunate copy/paste and editing snafu when posting the question and not noticing in the preview. – Jonathan Feb 9 '18 at 20:32
  • [root@nj-way-intranet:~]# subscription-manager repos --enable rhel-server-rhscl-7-rpms Error: 'rhel-server-rhscl-7-rpms' does not match a valid repository ID. Use "subscription-manager repos --list" to see valid repositories. – Jonathan Feb 9 '18 at 20:32
  • OK, so what's in the list? – Michael Hampton Feb 9 '18 at 20:37
  • pastebin.com/AxkSvi9f – Jonathan Feb 9 '18 at 20:57
  • Interesting. If you look up your system in Subscription Management on Red Hat's web site, what is the subscription attached to it? – Michael Hampton Feb 9 '18 at 21:19

I would install it from the extra packages (EPEL) repo. First, you'll want to ensure that the EPEL repository is configured (and enable the optional channel for RHEL too):

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm

For RHEL, run this command as well:

subscription-manager repos --enable=rhel-7-server-optional-rpms

Next, enable the remi-php71 repository:

yum install yum-utils
yum-config-manager --enable remi-php71

And now you can install PHP 7.1:

yum install php71

Doesnt answer your question about enabling your repo ( your fault seems to be with a weird whitespace in the middle of your penultimate command ) :

[root@nj-way-intranet:~]# subscription-manager repos --enable rhel-server-    rhscl-7-rpms
  • The spaces I think are an unfortunate side effect of copying and pasting. – Jonathan Feb 9 '18 at 20:30
  • [root@nj-way-intranet:~]# yum install php71 Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager No package php71 available. Error: Nothing to do – Jonathan Feb 9 '18 at 20:33
  • sorry i edited the wrong thing lol but I added a pastebin with the output of pastebin.com/AxkSvi9f added pastebin of repo list – Jonathan Feb 9 '18 at 20:55

If you have GUI/xserver on your rhel7 server, this will work.... (if not, comment back and we can use an appropriate wget command )

Head over to


and choose your preferred mirror to download the source code from. click the link and save the .tar.gz file to your system,

extract the contents and change directory to the new folder ( for me : ~/Downloads/php-7.1.14> )


lots of checks here... hopefully you get through them with no troubles, I had just one ...

configure: error: xml2-config not found. Please check your libxml2 installation.

which was solved by this SO answer:



(note there is no ./ with make above )

lots of output here, be patient

when finished, you 'could' run

make test

but I chose not to and ran directly,

make install

some output about installations... and finally

php -v

should give you

PHP 7.1.14 (cli) (built: Feb 11 2018 17:42:40) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies

hope it works for you. Sean

  • On my old RHEL5 server I did a compile of PHP/Apache2 and had weird issues I rather have it through the repo so it gets updated easier. – Jonathan Feb 13 '18 at 21:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.