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. 剑指offer 面试43题

    面试43题: 题目:1~n整数中1出现的次数 题:输入一个整数n,求1~n这n个整数的十进制表示中1出现的次数.例如,输入12,1~12这些整数中包含1的数字有1,10,11,12一共出现了5次. 解 ...

  2. Python学习进程(8)字符串內建函数

        Python字符串內建函数实现了string模块的大部分方法,并包括了对Unicode编码方式的支持.     (1)capitalize(): 将字符串的第一个字母变成大写,其他字母变小写. ...

  3. HTML5(。。。。不完整)

    <!DOCTYPE html>  不区分大小写 <header>.<nav>.<article>.<section>.<sidebar ...

  4. 编译android源码m、mm、mmm命令的使用

    http://blog.163.com/zz_forward/blog/static/212898222201442873435471/ gcc怎么查看它的默认include路径和库的路径呢? //- ...

  5. Python绿色版

    Python 安装的时候,有个选项,是问你要安装给所有用户还是只安装给当前用户,你只要选择当前用户,就会把那些需要的 dll ,包括 msvcr90.dll 都给装到 Python 目录下,你只要把 ...

  6. 树分治learning

    学习了树的点分治,树的边分治似乎因为复杂度过高而并不出众,于是没学 自己总结了一下 有些时候面对一些树上的结构 并且解决的是和路径有关的问题的时候 如果是多个询问 关注点在每次给出两个点,求一些关于这 ...

  7. java.lang.Exception: No runnable methods at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:191)

    使用方法测试时出现以下错误 java.lang.Exception: No runnable methods at org.junit.runners.BlockJUnit4ClassRunner.v ...

  8. Jedis分片连接池

    [http://blog.csdn.net/lang_man_xing/article/details/38405269]   一下内容来自网络,但是很多细节没有写出来,所以我经过自己琢磨,终于找到原 ...

  9. jedis中的一致性hash算法

    [http://my.oschina.net/u/866190/blog/192286] jredis是redis的java客户端,通过sharde实现负载路由,一直很好奇jredis的sharde如 ...

  10. spring: 使用嵌入式数据源 EmbeddedDatabaseBuilder

    嵌入式数据源作为应用的一部分运行,非常适合在开发和测试环境中使用,但是不适合用于生产环境.因为在使用嵌入式数据源的情况下,你可以在每次应用启动或者每次运行单元测试之前初始化测试数据. 使用Spring ...