HostOnNet Blog

Install PHP 7.0 on CentOS 7 Server

Looking for Linux Server Admin or WordPress Expert? We can help.

To install PHP 7 on CentOS 7 server, install epel and remi repository.

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm

Install PHP 7 from remi repository.

yum --enablerepo=remi update remi-release
yum --enablerepo=remi-php70 install php70-php php70-php-pear php70-php-bcmath php70-php-pecl-jsond-devel php70-php-mysqlnd php70-php-gd php70-php-common php70-php-fpm php70-php-intl php70-php-cli php70-php php70-php-xml php70-php-opcache php70-php-pecl-apcu php70-php-pecl-jsond php70-php-pdo php70-php-gmp php70-php-process php70-php-pecl-imagick php70-php-devel php70-php-mbstring

Enable remi-php70

yum install yum-utils
yum-config-manager --enable remi-php70

Restart apache

service httpd restart

Edit php.ini to your requirement

vi /etc/opt/remi/php70/php.ini

Posted in CentOS

Leave a Reply

Your email address will not be published. Required fields are marked *

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