来源:php官方文档

Init script setup
===

You will probably want to create an init script for your new php-fpm. Fortunately, PHP 5.3.3 provides one for you, which you should copy to your init directory and change permissions:

$ cp <php-5.3.3-source-dir>/sapi/fpm/init.d.php-fpm.in /etc/init.d/php-fpm
$ chmod 755 /etc/init.d/php-fpm

It requires a certain amount of setup. First of all, make sure your php-fpm.conf file is set up to  create a PID file when php-fpm starts. E.g.:
----
pid = /var/run/php-fpm.pid
----
(also make sure your php-fpm user has permission to create this file).

Now open up your new init script (/etc/init.d/php-fpm) and set the variables at the top to their relevant values. E.g.:
---
prefix=
exec_prefix=
php_fpm_BIN=/sbin/php-fpm
php_fpm_CONF=/etc/php-fpm.conf
php_fpm_PID=/var/run/php-fpm.pid
---

Your init script is now ready. You should now be able to start, stop and reload php-fpm:

$ /etc/init.d/php-fpm start
$ /etc/init.d/php-fpm stop
$ /etc/init.d/php-fpm reload

The one remaining thing you may wish to do is to add your new php-fpm init script to system start-up. E.g. in CentOS:

$ /sbin/chkconfig php-fpm on

===========

Disclaimer: Although I did just do this on my own server about 20 mins ago, everything I've written here is off the top of my head, so it may not be 100% correct. Also, allow for differences in system setup. Some understanding of what you are doing is assumed.

最新文章

  1. IOS开发基础知识--碎片38
  2. R读取溢出的数据
  3. MFC编程入门之二十七(常用控件:图片控件PictureControl)
  4. IELTS Writing Tips
  5. [转]菜鸟程序员之Asp.net MVC Session过期异常的处理
  6. 利用 Rational ClearCase ClearMake 构建高性能的企业级构建环境
  7. raspberry pi 如何汉化显示中文
  8. Oracle 中 call 和 exec的区别
  9. interblock corruption &amp; intrablock corruption
  10. 自定义控件winfrom
  11. OSX apache vhost 配置多站点时403错误解决方法
  12. python分页和session和计算时间差
  13. python3 pyqt5 和eric5配置教程
  14. ORACLE PL/SQL异常处理(Exception)学习笔记
  15. scip习题(1) scheme和c实现的对比
  16. AT NEW 和 AT END OF 的用法
  17. 面试中的Https
  18. stm32开发之串口的调试
  19. Ubuntu 系统安装详解 19.04最新版本
  20. Python学习心得--变量类型篇

热门文章

  1. android BottomNavigationView 底部显示3个以上的item
  2. python连接redis数据库的两种方式
  3. 运用session来控制用户的异地登录被挤下线情况
  4. 如何在Linux上升级java
  5. 51NOD 1202 子序列个数 DP
  6. Spark无法创建新线程
  7. Nodejs 定时任务
  8. SQLServer怎样把本地数据导入到远程服务器上(转载)
  9. SQL 数学串函数
  10. webpack前端构建工具学习总结(四)之自动化生成项目中的html页面