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 程序请求访问

  • 相关阅读:
    Linq To Entity 的增删改查(技术储备,怕忘了) jerry
    微博内容中的短地址 分析
    使用HttpWebRequest自动更新客户端应用程序[转]
    面向对象的js编程
    获取asp.net解析页面完毕后后的html代码
    js 面向对象继承 动物叫声比赛版
    [译]C# Socket连接请求超时机制
    c# 扫描可疑文件(找到木马)(简)转
    session如何保存在专门的StateServer服务器中
    动态加载script文件 专题
  • 原文地址:https://www.cnblogs.com/wanglan/p/7423827.html
Copyright © 2011-2022 走看看