Installing in Enterprise Linux distributions (CentOS, Scientific Linux, etc.)

suggest change

Use the yum command to manage packages in Enterprise Linux-based operating systems:

yum install php

This installs a minimal install of PHP including some common features. If you need additional modules, you will need to install them separately. Once again, you can use yum to search for these packages:

yum search 'php-*'

Example output:

php-bcmath.x86_64 : A module for PHP applications for using the bcmath library
php-cli.x86_64 : Command-line interface for PHP
php-common.x86_64 : Common files for PHP
php-dba.x86_64 : A database abstraction layer module for PHP applications
php-devel.x86_64 : Files needed for building PHP extensions
php-embedded.x86_64 : PHP library for embedding in applications
php-enchant.x86_64 : Human Language and Character Encoding Support
php-gd.x86_64 : A module for PHP applications for using the gd graphics library
php-imap.x86_64 : A module for PHP applications that use IMAP

To install the gd library:

yum install php-gd

Enterprise Linux distributions have always been conservative with updates, and typically do not update beyond the point release they shipped with. A number of third party repositories provide current versions of PHP:

IUS and Webtatic used replacement package names (for example php56u or php56w for PHP 5.6). Remi's repository upgrades in place and keeps the system package names. Webtatic has shut down.

The following commands install PHP 7.0 from Remi's repository on Enterprise Linux 6. PHP 7.0 and EL 6 are both past end of life. Current Remi modules use names such as remi-php83. Uninstalling the system packages is not required for this old example.

# download the RPMs; replace 6 with 7 in case of EL 7
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
wget http://rpms.remirepo.net/enterprise/remi-release-6.rpm
# install the repository information
rpm -Uvh remi-release-6.rpm epel-release-latest-6.noarch.rpm
# enable the repository
yum-config-manager --enable epel --enable remi --enable remi-safe --enable remi-php70
# install the new version of PHP
# NOTE: if you already have the system package installed, this will update it
yum install php

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents