How to install PHP7 using Yum

This guide will help you to upgrade php in your server from php 5.x to 7.0. The new php7 is quite fast, and have very less memory footprint compared to php5.x

Procedure

In this post, I have mentioned on how to install PHP 5 with nginx and varnish and mariaDB.

To install php7, you need to uninstall php5 initially.

yum -y remove php55u-bcmath php55u-cli php55u-common php55u-fpm php55u-gd php55u-imap php55u-intl php55u-mbstring php55u-mcrypt php55u-mysqlnd php55u-pdo php55u-pear php55u-pecl-memcache php55u-soap php55u-xml php55u-xmlrpc php55u-devel php55u-opcache

I am using the webtatic.com repo which I find the most easy of the all I have tried.

rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

Now Install php7

yum install php70w-bcmath php70w-cli php70w-common php70w-fpm php70w-gd php70w-imap php70w-intl php70w-mbstring php70w-mcrypt  php70w-mysqlnd php70w-pdo php70w-pear  php70w-xml php70w-xmlrpc php70w-devel php70w-opcache

Thats it!, Now go and configure your php.ini at /etc/php.ini and www.conf at /etc/php-fpm.d/www.conf

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Close Menu