zoukankan      html  css  js  c++  java
  • nginx 配置php

    安装php

    yum install php
     
    yum install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc

    添加nginx 默认主页index.php 

    vim /etc/nginx/conf.d/default.conf 

    location / {

            root   /usr/share/nginx/html;   //改路径

            index  index.html index.htm index.php;  //index.php

        }

    配置nginx支持php

    vim /etc/nginx/conf.d/default.conf 

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

        #

        location ~ .php$ {

            root           html;    //改路径

            fastcgi_pass   127.0.0.1:9000;

            fastcgi_index  index.php;

            fastcgi_param  SCRIPT_FILENAME  /usr/share/nginx/html$fastcgi_script_name;    //改路径

            include        fastcgi_params;

        }

    配置php-fpm

    vim /etc/php-fpm.d/www.conf

    ; Unix user/group of processes

    ; Note: The user is mandatory. If the group is not set, the default user's group

    ;       will be used.

    ; RPM: apache Choosed to be able to access some dir as httpd

    user = nginx

    ; RPM: Keep a group allowed to write in log dir.

    group = nginx

    chkconfig php-fpm on    #设置php-fpm自启动

    chkconfig mysqld on     #设置mysqld自启动

    service nginx restart   #重新启动nginx

    service php-fpm start   #启动php-fpm

    service mysqld start    #启动mysqld

  • 相关阅读:
    git分支管理之创建与合并分支
    git分支管理
    git远程仓库之从远程库克隆
    git远程仓库之添加远程库
    git远程仓库
    Git时光机穿梭之删除文件
    Git时光机穿梭之撤销修改
    Git时光机穿梭之管理修改
    Git时光机穿梭之工作区和暂存区
    Git时光机穿梭之版本回退
  • 原文地址:https://www.cnblogs.com/zhaocundang/p/5360880.html
Copyright © 2011-2022 走看看