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. asp.net mvc webform和razor的page基类区别

    接触过asp.net mvc的都知道,在传统的webform的模式下,page页面的基类是这样声明的: <%@ Page Language="C#" MasterPageFi ...

  2. Protobuf支持 pointf

    Protobuf支持 pointf序列化 加入:ProtoBuf.Meta.RuntimeTypeModel.Default.Add(typeof(System.Drawing.PointF), fa ...

  3. iOS UIFont 的学习与使用

    通常,我们使用字体 都是系统默认的字体. 有时候 从阅读体验,美观度 设计师都会考虑用一些 更高大尚的字体. 系统字体库 给英文 各种style的发挥空间很大,但是 中文则不然. 但是苹果 给使用中文 ...

  4. $ 用python处理Excel文档(1)——用xlrd模块读取xls/xlsx文档

    本文主要介绍xlrd模块读取Excel文档的基本用法,并以一个GDP数据的文档为例来进行操作. 1. 准备工作: 1. 安装xlrd:pip install xlrd 2. 准备数据集:从网上找到的1 ...

  5. Windos Server 2008 配置定时清理任务

    系统环境:Windos 2008 R2 x64 位 实施方案:自动清理超过两周的备份系统文件. 编写自动清理脚本..bat文件后缀. 打开计划任务

  6. leetcode刷题2:两数相加add_two_numbers

    题目:两数相加 (难度:中等) 给定两个非空链表来表示两个非负整数.位数按照逆序方式存储,它们的每个节点只存储单个数字. 将两数相加返回一个新的链表. 你可以假设除了数字 0 之外,这两个数字都不会以 ...

  7. Golang html encoding解析

    自动解析html页面的编码格式: 需要依赖 golang.org/x/text 和 golang.org/x/net 这两个外部库 package main import ( "net/ht ...

  8. Eclipse开发快捷键精选

    1.alt+?或alt+/:自动补全代码或者提示代码2.ctrl+o:快速outline视图3.ctrl+shift+r:打开资源列表4.ctrl+shift+f:格式化代码5.ctrl+e:快速转换 ...

  9. Excel下载打不开

    1.问题描述:今天遇到个问题,对于定时发送邮件,前两天还正常,今天发现邮件能收到,但打不开,显示如下错误: 预览邮件显示: 点击Excel打开,显示如下: 2.问题解决方案 删除对于服务器上部分空间内 ...

  10. 2018-02-11 发布 spring 自定义注解(annotation)与 aop获取注解

    知识点: Java自定义注解.spring aop @aspect的使用 首先我们先介绍Java自定义注解. 在开发过程中,我们实现接口的时候,会出现@Override,有时还会提示写@Suppres ...