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.

    原创文章,转载请注明来源
  • 相关阅读:
    想写点啥?
    网站优化记录
    freemarker了解
    spring理解
    mybatis了解
    struts机制
    SSM整合时初始化出现异常
    常用的正则表达式
    MySQL数据库安装配置步骤详解
    完全卸载MySQL数据库,实现重装
  • 原文地址:https://www.cnblogs.com/jerryqi/p/9556095.html
Copyright © 2011-2022 走看看