zoukankan      html  css  js  c++  java
  • How to install php 7.x on CentOS 7

    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.

    原创文章,转载请注明来源
  • 相关阅读:
    起泡排序引申出的问题
    关于NPC和NP-Hard问题
    我的书单(更新中)
    OpenCV2学习笔记03:Qt中配置OpenCV环境
    Ubuntu 14.04为浏览器添加Flash插件
    CSS3基础
    HTML5进阶
    拖拽上传及读取文件实现
    生产者消费者模型
    进程
  • 原文地址:https://www.cnblogs.com/jerryqi/p/9556095.html
Copyright © 2011-2022 走看看