Bleeding Edge PHP on CentOS 7

The PHP packages in the base / epel repositories are very conservative. To opt for something more current the REMI repo can be used.

Install the remi-release package (info)  first:

This will create the remi specific repo files in the /etc/yum.repo.d directory, specifically:

To install later PHP versions alongside your current PHP version you can specify the php56-* or php70-* packages, for example:

yum install php56 php56-php php56-php-cli php56-php-common php56-php-fpm php56-php-gd php56-php-mbstring php56-php-pdo php-mysqlnd

However to replace your existing PHP version (or install 5.6 from scratch)  you need to amend the /etc/yum.repo.d/remi.repo file. In that file you should see blocks for the specific versions of PHP. To choose a specific version of PHP set the enabled=0 to enabled=1 for that block. As an example, I wanted to use PHP 5.6 as my default PHP version so I amended the remi.repo file to the following:

After that I can install PHP (5.6) with:

The same method can be used for other PHP versions provided by remi.



Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">