標籤:虛擬機器 service 作業系統 start
實驗環境:
VM虛擬機器
CentOS作業系統
第一種方式:通過指令碼
[[email protected] ~]# cd /etc/init.d
[[email protected] init.d]# pkill php-fpm
[[email protected] init.d]# ps -ef|grep php-fpm
root 1657 1629 0 23:11 pts/0 00:00:00 grep php-fpm
[[email protected] init.d]# vi php-fpm #指令碼見附件
[[email protected] init.d]# chmod a+x php-fpm #添加執行許可權
[[email protected] init.d]# chkconfig --add php-fpm #加入服務
[[email protected] init.d]# chkconfig php-fpm on #開機自動啟動服務
[[email protected] init.d]# service php-fpm start
[[email protected] 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
第二種方式:
[[email protected] ~]# vi /etc/rc.local
#追加到末尾
/application/php/sbin/php-fpm
本文出自 “sky9890” 部落格,請務必保留此出處http://sky9896.blog.51cto.com/2330653/1881203
php-fpm自動啟動方式