• Nginx + PHP


    1、查看安装的php

     # rpm -qa | grep php  
    

     2、删除php

    # yum remove php

    3、使用yum remove不能彻底删除,要使用 rpm -e xxxx 把第一步列出的扩展 挨个删除,注意依赖情况

    # rpm -e php-fpm-5.3.3-22.el6.x86_64

    全新安装

    1、配置yum源

    centos 6.5
    # rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
    # rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
    centos 7.0
    # yum install epel-release
    # rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

    2、使用yum 查看安装包

    # yum list --enablerepo=remi --enablerepo=remi-php56 | grep php

    3、安装,需要其他扩展包在后边加上即可

    # yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof

    php-fpm 加入系统服务随系统启动而启动

    # chkconfig --level 345 php-fpm on 

    第一次启动php-fpm

    # /etc/init.d/php-fpm restart 
    Stopping php-fpm:                                          [FAILED]
    Starting php-fpm:                                          [  OK  ]

    配置nginx

    location ~ .php$ {  
        root           html;  
        fastcgi_pass   127.0.0.1:9000;  #php-fpm的端口号
        fastcgi_index  index.php;  
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;  
        include        fastcgi_params;  
    }  

    重启nginx

    # /etc/init.d/nginx -s reload  
  • 相关阅读:
    Consul 学习文章链接
    秒懂:tomcat 最大线程数 最大连接数
    使用 Spring Cloud Sleuth 实现链路监控 (转)
    (转)Java中OutOfMemoryError(内存溢出)的三种情况及解决办法
    @RequestMapping 用法
    Spring 常用的几种注解
    [转] Spring MVC 深入分析
    [转]session listener的配置和使用
    web.xml中 Log4jConfigListener配置
    [mysql] 手动备份数据
  • 原文地址:https://www.cnblogs.com/whcghost/p/6809004.html
Copyright © 2020-2023  润新知