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

  • 相关阅读:
    2021年下半年北京市中小学教师资格考试笔试报名公告
    高效演讲
    php的Allowed memory size of 134217728 bytes exhausted问题解决办法
    1111error
    http 500 错误
    xshell连接centons
    Vue 计算属性
    Vue 自定义指令
    Vue 事件绑定
    Vue v-cloak指令解决插值表达式“闪动”问题
  • 原文地址:https://www.cnblogs.com/wanglan/p/7423827.html
Copyright © 2011-2022 走看看