centos7通过yum安装nginx、php-fpm方法

 时间:2026-05-01 03:29:11

1、移除已经存在的http和php包

yum remve httpd* php*

centos7通过yum安装nginx、php-fpm方法

2、安装nginx

centos7通过yum安装nginx、php-fpm方法

3、安装php和php-fpm

yum install php php-fpm

centos7通过yum安装nginx、php-fpm方法

4、安装php扩展

yum install php-gd php-mysql php-mbstring php-xml php-mcrypt  php-imap php-odbc php-pear php -xmlrpc

centos7通过yum安装nginx、php-fpm方法

5、启动nginx和php-fpm服务

centos7通过yum安装nginx、php-fpm方法

6、将nginx和php进行关联

vim /etc/nginx/nginx.conf

在http模块中添加配置:

location / {

root   /usr/share/nginx/html;

index  index.html index.htm index.php;

}

location ~ \.php$ {

root           html;

fastcgi_pass   127.0.0.1:9000;

fastcgi_index  index.php;

fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

include        fastcgi_params;

}

centos7通过yum安装nginx、php-fpm方法

7、将php-fpm和nginx的启动用户统一

centos7通过yum安装nginx、php-fpm方法

8、统一用户之后重启php-fpm和nginx进程并验证页面

centos7通过yum安装nginx、php-fpm方法

  • OCR中添加ASM DG资源
  • elasticsearch安装head 插件方法
  • win如何安装weblogic12.2(一)
  • rhel6.4 yum本地yum源配置
  • 如何使用虚拟机安装oracle11gRAC(十)
  • 热门搜索
    股票成交量怎么看 肚脐左边疼是怎么回事 绿豆芽怎么炒好吃 簸箕怎么读 魍魉怎么读 我的世界楼梯怎么做 眼球突出怎么恢复 精华怎么用 鲁班是怎么发明锯子的 晚上睡觉多梦怎么治