php-fpm啟動腳本


1.安裝php時,在源碼目錄下默認有個腳本文件,拷貝到/etc/init.d目錄下就可以直接用

[root@web-node01 ~]# cp /usr/local/src/php-5.6.20/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

2.注意,php-fpm啟動腳本依賴與php-fpm.pid文件,此時需要在php-fpm.conf開啟pid參數

[root@web-node01 ~]# vim /usr/local/php/etc/php-fpm.conf
  1 ;;;;;;;;;;;;;;;;;;;;;
  2 ; FPM Configuration ;
  3 ;;;;;;;;;;;;;;;;;;;;;
  4 
  5 ; All relative paths in this configuration file are relative to PHP's install
  6 ; prefix (/usr/local/php-5.6.20). This prefix can be dynamically changed by using the
  7 ; '-p' argument from the command line.
  8 
  9 ; Include one or more files. If glob(3) exists, it is used to include a bunch of
 10 ; files from a glob(3) pattern. This directive can be used everywhere in the
 11 ; file.
 12 ; Relative path can also be used. They will be prefixed by:
 13 ;  - the global prefix if it's been set (-p argument)
 14 ;  - /usr/local/php-5.6.20 otherwise
 15 ;include=etc/fpm.d/*.conf
 16 
 17 ;;;;;;;;;;;;;;;;;;
 18 ; Global Options ;
 19 ;;;;;;;;;;;;;;;;;;
 20 
 21 [global]
 22 ; Pid file
 23 ; Note: the default prefix is /usr/local/php-5.6.20/var
 24 ; Default Value: none
 25 pid = run/php-fpm.pid             # 注釋取消
 26 

3.啟動測試

[root@web-node01 ~]# /etc/init.d/php-fpm stop
Gracefully shutting down php-fpm . done
[root@web-node01 ~]# /etc/init.d/php-fpm start
Starting php-fpm  done

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM