zoukankan      html  css  js  c++  java
  • centos 7 安装 php 5.5 5.6 7.0

    查看当前安装的PHP包

    [root@node1 ~]# yum list installed | grep php
    php56w.x86_64
    5.6.31-1.w7 @webtatic php56w-cli.x86_64 5.6.31-1.w7 @webtatic php56w-common.x86_64 5.6.31-1.w7 @webtatic php56w-gd.x86_64 5.6.31-1.w7 @webtatic php56w-ldap.x86_64 5.6.31-1.w7 @webtatic php56w-mbstring.x86_64 5.6.31-1.w7 @webtatic php56w-mcrypt.x86_64 5.6.31-1.w7 @webtatic php56w-mysql.x86_64 5.6.31-1.w7 @webtatic php56w-pdo.x86_64 5.6.31-1.w7

    如果有安装包,先删除

     yum remove php.4 php56*

    配置安装源

    [root@node1 ~]# rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
    Retrieving https://mirror.webtatic.com/yum/el7/epel-release.rpm
    Preparing...                          ################################# [100%]
        package epel-release-7-10.noarch (which is newer than epel-release-7-5.noarch) is already installed
    
    [root@node1 ~]# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
    Retrieving https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
    Preparing...                          ################################# [100%]
        package webtatic-release-7-3.noarch is already installed

    安装 php 5.5

    yum -y install php55w.x86_64 php55w-cli.x86_64 php55w-common.x86_64 php55w-gd.x86_64 php55w-ldap.x86_64 php55w-mbstring.x86_64 php55w-mcrypt.x86_64 php55w-mysql.x86_64 php55w-pdo.x86_64

    安装 php 5.6

    [root@node1 ~]# yum -y install php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mcrypt.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64

    安装 php 7.0

    yum install -y php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-mysql.x86_64 php70w-pdo.x86_64

    安装 php fpm

    [root@node1 ~]# yum -y install php55w-fpm 
    [root@node1 ~]# yum -y install php56w-fpm 
    [root@node1 ~]# yum -y install php70w-fpm

    查看版本

    [root@node1 ~]# php -v
    PHP 5.6.31 (cli) (built: Jul  7 2017 06:28:10) 
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

    启动php

    [root@node1 ~]# service php-fpm start

    关闭

    [root@node1 ~]# service php-fpm stop

    重启

    [root@node1 ~]# service php-fpm restart

     查看进程

    [root@node1 ~]# ps -ef | grep php-fpm

    查看端口

    [root@node1 ~]# lsof -i :9000

    配置文件在

    [root@node1 ~]# vim /etc/php.ini 

     配置nginx 支持PHP 程序请求访问

  • 相关阅读:
    C++类构造函数初始化列表
    VC++检测硬件设备状态
    MFC中调用Windows API函数的方式
    DEBUG无法进入断点解决方法
    【转】c++数组初始化
    vc++实现控制USB设备启用与否
    3d图像坐标轴及css3属性的讲解
    Ajax的兼容及Ajax的缓存问题
    Ajax中最有名axios插件(只应用于Ajax)(post方法,官网写错了,应是字符串格式)
    文档碎片及xml讲解
  • 原文地址:https://www.cnblogs.com/wanglan/p/7423827.html
Copyright © 2011-2022 走看看