码迷,mamicode.com
首页 > Web开发 > 详细

php-fpm自动启动方式

时间:2016-12-09 20:05:56      阅读:206      评论:0      收藏:0      [点我收藏+]

标签:虚拟机   service   操作系统   start   

实验环境:

VM虚拟机

CentOS操作系统

第一种方式:通过脚本

[root@www ~]# cd  /etc/init.d

[root@www init.d]# pkill  php-fpm

[root@www init.d]# ps  -ef|grep php-fpm

root      1657  1629  0 23:11 pts/0    00:00:00 grep php-fpm

[root@www init.d]# vi  php-fpm      #脚本见附件

[root@www init.d]# chmod  a+x  php-fpm  #添加执行权限

[root@www init.d]# chkconfig  --add  php-fpm  #加入服务

 [root@www init.d]# chkconfig  php-fpm  on   #开机自动启动服务

[root@www init.d]# service php-fpm start 

[root@www init.d]# ps -ef|grep php-fpm

root      1673     1  0 23:13 ?        00:00:00 php-fpm: master process (/application/php5.3.27/etc/php-fpm.conf)

nginx     1674  1673  0 23:13 ?        00:00:00 php-fpm: pool www           

nginx     1675  1673  0 23:13 ?        00:00:00 php-fpm: pool www           

root      1677  1629  0 23:13 pts/0    00:00:00 grep php-fpm

第二种方式:

[root@www ~]# vi /etc/rc.local

#追加到末尾

/application/php/sbin/php-fpm

本文出自 “sky9890” 博客,请务必保留此出处http://sky9896.blog.51cto.com/2330653/1881203

php-fpm自动启动方式

标签:虚拟机   service   操作系统   start   

原文地址:http://sky9896.blog.51cto.com/2330653/1881203

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!