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. LeetCode:全排列【46】

    LeetCode:全排列[46] 题目描述 给定一个没有重复数字的序列,返回其所有可能的全排列. 示例: 输入: [1,2,3] 输出: [ [1,2,3], [1,3,2], [2,1,3], [2 ...

  2. Android:日常学习笔记(9)———探究广播机制

    Android:日常学习笔记(9)———探究广播机制 引入广播机制 Andorid广播机制 广播是任何应用均可接收的消息.系统将针对系统事件(例如:系统启动或设备开始充电时)传递各种广播.通过将 In ...

  3. 我的npm笔记

    本文记录一些npm的使用技巧,主要包括自己常用的命令,做个备忘. NPM 是什么? NPM是NodeJS的包管理工具,现在已经进一步发展,致力于为很多其他平台提供包管理工具,其核心思想就是让包的安装更 ...

  4. javascript;Jquery;获取JSON对象,无刷新评论实例。

      <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> < ...

  5. Ajax在jQuery中的应用---ajax()方法

    在jQuery中,$.ajax()方法是最底层的方法,也是功能最强的方法.其调用的语法格式为: $.ajax([options]) 其中,可选项参数[options]为$.ajax()方法中的请求设置 ...

  6. VMWare中安装windowsXP遇到的问题

    XP系统安装 1.安装Windows和安装linux不一样,创建虚拟机完成后Linux自动根据硬盘进行系统安装,不需要提前分区.而windows必须进行提前分区,这个分区是在虚拟磁盘上完成的,就是你创 ...

  7. TIJ读书笔记02-控制执行流程

      TIJ读书笔记02-控制执行流程 TIJ读书笔记02-控制执行流程 if-else 迭代 无条件分支 switch语句 所有条件语句都是以条件表达式的真假来决定执行路径,也就是通过布尔测试结果来决 ...

  8. Django框架之HTTP本质

    1.Http请求本质 浏览器(socket客户端): socket.connect(ip,端口) socket.send("http://www.xiaohuar.com/index.htm ...

  9. php数组函数-array_flip()

    array_flip()函数返回一个反转后的数组,如果同一个值出现多次,则最 后一个键名作为它的值,所有其他的键名将丢失. 如果原数组中的值得数据类型不是字符串或整数,函数将报错. array_fli ...

  10. 解决Newtonsoft.Json版本问题

    在配置文件中添加以下代码,App.config或Web.config <runtime> <assemblyBinding xmlns="urn:schemas-micro ...