At the terminal, let's first see if you have this on your server:
rpm -qa | grep php
This command rpm -qa
list everything installed on your box. Pipe it through grep
to only show lines containing 'php' and you should see a decent list. On my dev box, I see output as such...
$ rpm -qa | grep php
php-5.3.3-40.el6_6.x86_64
php-mbstring-5.3.3-40.el6_6.x86_64
php-pecl-memcache-3.0.5-4.el6.x86_64
php-mysql-5.3.3-40.el6_6.x86_64
php-ldap-5.3.3-40.el6_6.x86_64
php-cli-5.3.3-40.el6_6.x86_64
php-pear-XML-Parser-1.3.4-1.el6.noarch
php-gd-5.3.3-40.el6_6.x86_64
php-pear-1.9.4-4.el6.noarch
php-pear-XML-RSS-1.0.1-1.el6.noarch
php-xml-5.3.3-40.el6_6.x86_64
php-common-5.3.3-40.el6_6.x86_64
php-pdo-5.3.3-40.el6_6.x86_64
Now if you don't see it, attempt to install it via yum
. If however, your server returns something like No package php-mbstring available or like this below:
$ sudo yum install php-mbstring
[sudo] password for mr-super-cool:
Loaded plugins: product-id, rhnplugin, subscription-manager
This system is receiving updates from RHN Classic or Red Hat Satellite.
No package php-mbstring available.
Error: Nothing to do
That means you probably need to subscribe to the Extra Packages for Enterprise Linux (EPEL) Repository. Cyberciti describes this as:
EPEL (Extra Packages for Enterprise Linux) is a volunteer-based
community effort from the Fedora project to create a repository of
high-quality add-on packages that complement the Fedora-based Red Hat
Enterprise Linux (RHEL) and its compatible spinoffs, such as CentOS
and Scientific Linux.
That same page has instructions for RHEL 5 and RHEL 6:
RHEL 5.x / CentOS 5.x Users
Type the following command as root user to install repo:
# rpm -Uvh http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
RHEL 6.x / CentOS 6.x Users
Type the following command as root user to install repo:
# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
For RHEL 7
For RHEL 7 let yum take care of that for you.
$ sudo yum install epel-release
$ sudo systemctl restart httpd.service