zoukankan      html  css  js  c++  java
  • linux:安装php7.x

    参考:链接

    更新yum源

    CentOS/RHEL 7.x:

    rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
    rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

    CentOS/RHEL 6.x:

    rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
    rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

    安装php7.x

    yum install php70w-fpm php70w php70w-mysql

    检测

    查看版本

    php -v

    页面测试

    1、默认的Apache站点目录:/var/www/html/

    创建一个index.php文件

    检测

    2、验证 LNMP 环境是否搭建成功

    a、创建测试文件

    echo "<?php phpinfo(); ?>" >> /usr/share/nginx/html/index.php

    b、重启 Nginx 服务

    systemctl restart nginx

    c、测试

    报错

    Resolving Dependencies
    --> Running transaction check
    ---> Package php70w.x86_64 0:7.0.20-1.w6 will be installed
    --> Processing Dependency: php70w-common(x86-64) = 7.0.20-1.w6 for package: php70w-7.0.20-1.w6.x86_64
    --> Processing Dependency: php70w-cli(x86-64) = 7.0.20-1.w6 for package: php70w-7.0.20-1.w6.x86_64
    --> Processing Dependency: php70w-cli = 7.0.20-1.w6 for package: php70w-7.0.20-1.w6.x86_64
    --> Processing Dependency: httpd-mmn = 20051115 for package: php70w-7.0.20-1.w6.x86_64
    --> Running transaction check
    ---> Package php70w.x86_64 0:7.0.20-1.w6 will be installed
    --> Processing Dependency: httpd-mmn = 20051115 for package: php70w-7.0.20-1.w6.x86_64
    ---> Package php70w-cli.x86_64 0:7.0.20-1.w6 will be installed
    ---> Package php70w-common.x86_64 0:7.0.20-1.w6 will be installed
    --> Processing Dependency: libgmp.so.3()(64bit) for package: php70w-common-7.0.20-1.w6.x86_64
    --> Finished Dependency Resolution
    Error: Package: php70w-common-7.0.20-1.w6.x86_64 (webtatic)
    Requires: libgmp.so.3()(64bit)
    Error: Package: php70w-7.0.20-1.w6.x86_64 (webtatic)
    Requires: httpd-mmn = 20051115
    Installed: httpd-2.4.6-45.el7.centos.4.x86_64 (@updates)
    httpd-mmn = 20120211
    httpd-mmn = 20120211x8664
    httpd-mmn = 20120211-x86-64
    Available: httpd-2.4.6-45.el7.centos.x86_64 (base)
    httpd-mmn = 20120211x8664
    httpd-mmn = 20120211-x86-64
    httpd-mmn = 20120211
    You could try using --skip-broken to work around the problem
    You could try running: rpm -Va --nofiles --nodigest

    方法:

    yum clean all  //清除缓存

    再次执行!

    设置开机自启动

    chkconfig --add php-fpm
    chkconfig php-fpm on
  • 相关阅读:
    RecSys Challenge 2015
    Python 多行注释
    编译型语言与解释型语言
    vs2012 提示 未能正确加载 "Visual C++ Language Manager Package" 包
    人工智能 VS 机器学习 VS 深度学习
    CV-视频分析:静态背景下的运动检测
    消费者做出购买决策的流程
    Fat jar用途
    Eclipse中打包插件Fat Jar的安装与使用
    Eclipse将引用了第三方jar包的Java项目打包成jar文件的两种方法
  • 原文地址:https://www.cnblogs.com/pam-sh/p/13186948.html
Copyright © 2011-2022 走看看