Step 1: Setup the Webtatic YUM repo

Precompiled PHP 7.x binaries are available for CentOS 7 from the WebtaticIUS, or Remi’s RPM repositories.

Below are instructions on installing PHP 7.x using the Webtatic YUM repo.

Setup the Webtatic YUM repo:

sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

Step 2: Install PHP 7.1 and necessary extensions

Install PHP 7.1 and some of the most commonly used extensions:

sudo yum install -y mod_php71w php71w-cli php71w-common php71w-gd php71w-mbstring php71w-mcrypt php71w-mysqlnd php71w-xml

Note: The above packages are for general purpose use and may not suit your specific requirements. You should confirm the packages to be installed referring to the Webtatic PHP 7.1 introduction page.

Alternatively, if you want to install PHP 7.0, you should refer to Webtatic PHP 7.0 introduction page.

Step 3: configure PHP 7.x

After the installation, the PHP 7.x configuration file will be saved as /etc/php.ini. If necessary, you can use the vi text editor to modify it:

sudo cp /etc/php.ini /etc/php.ini.bak
sudo vi /etc/php.ini

Remember to restart your web server after modifying the /etc/php.ini file.

For Apache:

sudo systemctl restart httpd.service

For Nginx:

sudo systemctl restart nginx.service php-fpm.service

That’s it. Thanks for reading.

How to install php 7.x on CentOS 7的更多相关文章

  1. Install FFMPEG and FFMPEG-PHP in CentOS 6 with Virtualmin

    Install FFMPEG and FFMPEG-PHP in CentOS 6 with Virtualmin  1 year ago -  by Daniel -  howto centos v ...

  2. Install Erlang and Elixir in CentOS 7

    In this tutorial, we will be discussing about how to install Erlang and Elixir in CentOS 7 minimal s ...

  3. Install Maya 2015 x64 in CentOS 7

    Thanks for Must(QQ ID)'s big help for installing Maya in CentOS7. This is my steps for installing ma ...

  4. How to install Wordpress 4.0 on CentOS 7.0

    This document describes how to install and configure Wordpress 4.0 on CentOS 7.0. WordPress started ...

  5. How to install GSL on linux(ubuntu,centos,redhat)

    Test: ftp://ftp.gnu.org/gnu/gsl/gsl-1.15.tar.gz  success. ftp://ftp.gnu.org/gnu/gsl/gsl-1.13.0.tar.g ...

  6. How To install FFMPEG, FLVTOOL2, MP4Box on CentOS server 2015 easy method

    for i386:wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpmrpm ...

  7. Install TightVNC Server in RHEL/CentOS and Fedora to Access Remote Desktops

    Virtual Networking Computing (VNC) is a Kind of remote sharing system that makes it possible to take ...

  8. How to install Redis 3.2 on CentOS 6 and 7

    What is Redis? Redis is a flexible open-source, key value data store, used as a database, cache and ...

  9. [转载]How To Install Nginx And PHP-FPM On CentOS 6 Via Yum

    http://www.lifelinux.com/how-to-install-nginx-and-php-fpm-on-centos-6-via-yum/ http://blog.csdn.net/ ...

  10. Install Haskell on Ubuntu and CentOS

    For Ubuntu: Step one: Install GHC If you don't want to install curl you can skip step 1 and just dir ...

随机推荐

  1. C#数组存入引用类型

    using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Cont ...

  2. JQuery 操作 checkbox 二次赋值无效 attr ----> prop

    CheckBox .attr('checked',false);  Chrome和火狐第二次点击无效. 然后解决了把attr 改成了 prop 以后操作属性的时候各位记下,用prop 因为大家用的都是 ...

  3. bacula 备份恢复

    一.数据恢复: 在bacula服务器执行: /opt/bacula/etc/ bconsole #进入交互窗口 *restore #输入restore恢复命令 Automatically select ...

  4. Windows彻底卸载VMWare虚拟机

    彻底卸载VMWare虚拟机 1.停止VMware相关服务 在服务中将VMware开头的所有服务停止 2.打开VMware安装向导 进入卸载页面 在卸载页面中选中VMware右键点击,进入更改后,页面为 ...

  5. python中的值传递和引用传递

    Python中的变量是没有类型的,我们可以把它看做一个(*void)类型的指针,变量是可以指向任何对象的,而对象才是有类型的. Python中的对象有可变对象(number,string,tuple等 ...

  6. 用C#编写猜数、九九乘法表‘、迷宫

    using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threa ...

  7. python中初始化实例属性

    虽然我们可以自由地给一个实例绑定各种属性,但是,现实世界中,一种类型的实例应该拥有相同名字的属性.例如,Person类应该在创建的时候就拥有 name.gender 和 birth 属性,怎么办? 在 ...

  8. Qt Ping

    QProcess对象可以直接执行cmd的命令,但是ping操作是会阻塞的,所以需要在子线程里ping QProcess *tempCmd = new QProcess(); tempCmd->s ...

  9. Qt下TCP编程

    一.服务器 1.声明一个QTcpServer对象 QTcpServer* serverListener; 2.new出对象 this->serverListener = new QTcpServ ...

  10. Kubernetes pod网络解析

    在Kubernetes中,会为每一个pod分配一个IP地址,pod内的所有容器都共享这个pod的network namespace,彼此之间使用localhost通信. 那么pod内所有容器间的网络是 ...