Setting RHEL default yum repositories

bdares asked:

I’ve been tasked with setting up PHP on a RHEL 6 server.

running yum install php gives me the following output:

Loaded plugins: product-id, refresh-packagekit, security, subscription-manager 
Updating certificate-based repositories. 
Setting up Install Process 
No package php available. 
Error: Nothing to do

There are two files in /etc/yum.repos.d:

redhat.repo:

#
# Certificate-Based Repositories
# Managed by (rhsm) subscription-manager
#

rhel-source.repo:

[rhel-source]
name=Red Hat Enterprise Linux $releasever - $basearch - Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/SRPMS/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[rhel-source-beta]
name=Red Hat Enterprise Linux $releasever Beta - $basearch - Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/SRPMS/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

I’ve looked around and it seems that this is not the default configuration. I want to restore the RHEL6 repositories (which should include PHP 5.1, I believe). What can I do?

(updated in response to @ewwhite):

# rpm -qi php
package php is not installed
# yum repolist
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
repolist: 0

My answer:


Your system doesn’t appear to have a valid entitlement.

Register the system and assign it an active subscription to gain access to the Red Hat software repositories.

P.S. RHEL 6 ships with PHP 5.3.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.