0

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:

https://pastebin.com/AxkSvi9f

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
Jonathan
  • 151
  • 2
  • 2
  • 6

4 Answers4

0
  1. Install yum-utils and enable EPEL repository

Login to your server and use the below yum command to install yum-utils & enable epel repository

[root@actsupport ~]# yum install epel-release yum-utils -y

Download and Install remirepo using yum command

[root@actsupport ~]# yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm

  1. Based on your requirement, configure the PHP 7.x repository

To configure PHP 7.1 repository, use below command,

[root@actsupport ~]# yum-config-manager --enable remi-php71

To configure PHP 7.2 repository, use below command,

[root@actsupport ~]# yum-config-manager --enable remi-php72

To configure PHP 7.3 repository, use below command

[root@actsupport ~]# yum-config-manager --enable remi-php73

To configure PHP 7.4 repository, use below command

[root@actsupport ~]# yum-config-manager --enable remi-php74

Install PHP 7.4 along with dependencies.

[root@actsupport ~]# yum install php php-common php-opcache php-mcrypt php-cli php-gd php-curl php-mysql -y

Note: To search all PHP modules use the below command:

[root@actsupport ~]# yum search php | more Verify the PHP version

Once PHP and its dependencies are installed in step 4), use the below command to verify the installed PHP version,

[root@actsupport ~]# php -v
PHP 7.4.4 (cli) (built: Mar 17 2020 10:40:21) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.4, Copyright (c), by Zend Technologies
[root@actsupport ~]#
Ryan
  • 137
  • 4
0

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

(As discussed in comments) Note that the Software Collections repo is not available on systems which are on Extended Update Support. The system will need to be taken off EUS and updated to the most current minor release in order to use Red Hat's Software Collections.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
  • The space above was an unfortunate copy/paste and editing snafu when posting the question and not noticing in the preview. – Jonathan Feb 09 '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 09 '18 at 20:32
  • OK, so what's in the list? – Michael Hampton Feb 09 '18 at 20:37
  • https://pastebin.com/AxkSvi9f – Jonathan Feb 09 '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 09 '18 at 21:19
  • I am awful at navigating that website, all I see if subscribed, Extended Update Support, Red Hat Enterprise Linux Server - Extended Update Support, and on content there are 42 entries for rhel7-7...i assume you want all those? I will paste it in my original question. – Jonathan Feb 13 '18 at 21:38
  • @Jonathan Hmm. If you put the system on Extended Update Support, you might not be able to do this at all. At this point I suggest you open a case with Red Hat. – Michael Hampton Feb 13 '18 at 22:49
  • Good idea contacting RH now. thanks for the help, was hoping it would be an easy fix. – Jonathan Feb 14 '18 at 19:07
0

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
Sean Davey
  • 101
  • 2
  • The spaces I think are an unfortunate side effect of copying and pasting. – Jonathan Feb 09 '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 09 '18 at 20:33
  • sorry i edited the wrong thing lol but I added a pastebin with the output of https://pastebin.com/AxkSvi9f **added pastebin of repo list** – Jonathan Feb 09 '18 at 20:55
0

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

http://php.net/get/php-7.1.14.tar.gz/from/a/mirror

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> )

./configure

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:

https://stackoverflow.com/questions/19904083/how-to-fix-error-with-xml2-config-not-found-when-installing-php-from-sources

make

(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

Sean Davey
  • 101
  • 2
  • 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