使用yum快速安装nginx、php

2025-10-22 01:45:04

1、安装yum源

yum install epel-release

使用yum快速安装nginx、php

2、安装php

yum install php-fpm php-cli php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-magickwand php-magpierss php-mbstring php-mcrypt php-mssql php-shout php-snmp php-soap php-tidy

清除、生成cache和安装是一个漫长的过程

使用yum快速安装nginx、php

使用yum快速安装nginx、php

3、先找到php服务然后启动它

[root@remote ~]# systemctl list-unit-files|grep php

php-fpm.service                               disabled

[root@remote ~]# systemctl start php-fpm.service

[root@remote ~]# ps -ef|grep php

root     37830     1  1 23:36 ?        00:00:00 php-fpm: master process (/etc/php-fpm.conf)

apache   37832 37830  0 23:36 ?        00:00:00 php-fpm: pool www

apache   37833 37830  0 23:36 ?        00:00:00 php-fpm: pool www

apache   37834 37830  0 23:36 ?        00:00:00 php-fpm: pool www

apache   37835 37830  0 23:36 ?        00:00:00 php-fpm: pool www

apache   37836 37830  0 23:36 ?        00:00:00 php-fpm: pool www

root     37865 37526  0 23:36 pts/2    00:00:00 grep --color=auto php

使用yum快速安装nginx、php

4、设置php-fpm随系统自动启动

systemctl enable php-fpm.service

使用yum快速安装nginx、php

使用yum快速安装nginx、php

5、安装nginx需要先下载nginx的源并安装

wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm

rpm -ivh nginx-release-centos-6-0.el6.ngx.noarch.rpm

安装完nginx源之后再使用yum install nginx命令安装

使用yum快速安装nginx、php

使用yum快速安装nginx、php

6、启动nginx并设置nginx随系统自动启动

[root@remote src]# systemctl list-unit-files|grep nginx

nginx.service                                 disabled

[root@remote src]# systemctl start nginx.service 

[root@remote src]# systemctl enable nginx.service      

Created symlink from /etc/systemd/system/multi-user.target.wants/nginx.service to /usr/lib/systemd/system/nginx.service.

[root@remote src]# ps -ef|grep nginx

root     39589     1  0 23:44 ?        00:00:00 nginx: master process /usr/sbin/nginx

nginx    39590 39589  0 23:44 ?        00:00:00 nginx: worker process

root     39651 37526  0 23:45 pts/2    00:00:00 grep --color=auto nginx

使用yum快速安装nginx、php

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
相关推荐
  • 阅读量:39
  • 阅读量:163
  • 阅读量:186
  • 阅读量:118
  • 阅读量:97
  • 猜你喜欢