php-fpm 在centos 7下的安裝配置

安裝php:php

sudo yum install php php-fpm php-mysql php-mbstring php-mcrypt php-sockets php-curl php-common php-xml php-soap

啓動php-fpm:html

sudo systemctl start php-fpm

設置自動啓動:mysql

sudo systemctl enable php-fpm

查看啓動是否成功:nginx

ps aux | grep php-fpm

配置nginx經過fast-cgi方式支持php:sql

vi /etc/nginx/conf.d/default.conf 

# 去掉文件裏已經有的相似這一段的註釋,能夠根據本身的須要修改, 若是配置文件裏沒有也能夠本身加上。

    location ~ \.php$ {
          root           html;
          fastcgi_pass   127.0.0.1:9000;
          fastcgi_index  index.php;
          fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
          include        fastcgi_params;
    }
相關文章
相關標籤/搜索