Home Backend Development PHP Tutorial Solution to garbled php-fpm executable file

Solution to garbled php-fpm executable file

Jul 25, 2016 am 08:53 AM

  1. cp/usr/local/php/etc/php-fpm.conf.default->/usr/local/php/etc/php-fpm.conf
复制代码

vi/usr/local/php/etc/php-fpm.conf

制作fpm启动服务 vi/etc/init.d/php-fpm,保存

  1. <p>#!/bin/bash
  2. #php-fpmStartupscriptforphp-fpm,aFastCGIimplementation
  3. #thisscriptwascreatedbytonyat2010.07.21,basedonjackbillow'snginxscript.
  4. #itisv.0.0.1version.
  5. #ifyoufindanyerrorsonthisscripts,pleasecontacttony.
  6. #bysendingmailtotonytzhouatgmaildotcom.
  7. #
  8. #chkconfig:-8515
  9. #description:php-fpmisanalternativeFastCGIimplementation,withsomeadditionalfeaturesusefulforsitesofanysize,especiallybusiersites.
  10. #
  11. #processname:phpfpm
  12. #pidfile:/usr/local/php/var/run/phpfpm.pid
  13. #config:/usr/local/php/etc/phpfpm.conf
  14. phpfpm=/usr/local/php/sbin/php-fpm
  15. config=/usr/local/php/lib/php.ini
  16. pid=/usr/local/php/var/run/php-fpm.pid
  17. RETVAL=0
  18. prog="phpfpm"
  19. #Sourcefunctionlibrary.
  20. ./etc/rc.d/init.d/functions
  21. #Sourcenetworkingconfiguration.
  22. ./etc/sysconfig/network
  23. #Checkthatnetworkingisup.
  24. [${NETWORKING}="no"]&&exit0
  25. [-x$phpfpm]||exit0
  26. #Startphpfpmdaemonsfunctions.
  27. start(){
  28. if[-e$pid];then
  29. echo"phpfpmisalreadyrunning...."
  30. exit1
  31. fi
  32. echo-n$"Starting$prog:"
  33. daemon$phpfpm-c${config}
  34. RETVAL=$?
  35. echo
  36. [$RETVAL=0]&&touch/var/lock/subsys/phpfpm
  37. return$RETVAL
  38. }
  39. #Stopphpfpmdaemonsfunctions.
  40. stop(){
  41. echo-n$"Stopping$prog:"
  42. killproc$phpfpm
  43. RETVAL=$?
  44. echo
  45. [$RETVAL=0]&&rm-f/var/lock/subsys/phpfpm/var/run/phpfpm.pid
  46. }
  47. #reloadphpfpmservicefunctions.
  48. reload(){
  49. echo-n$"Reloading$prog:"
  50. #kill-HUP`cat${pid}`
  51. killproc$phpfpm-HUP
  52. RETVAL=$?
  53. echo
  54. }
  55. #Seehowwewerecalled.
  56. case"$1"in
  57. start)
  58. start
  59. ;;
  60. stop)
  61. stop
  62. ;;
  63. reload)
  64. reload
  65. ;;
  66. restart)
  67. stop
  68. start
  69. ;;
  70. status)
  71. status $prog
  72. RETVAL=$?</p>
  73. <p>*)
  74. echo $"Usage:$prog{start|stop|restart|reload|status|help}"
  75. exit 1
  76. esac
  77. exit $RETVAL</p>
复制代码

后续操作步骤: 添加执行权限 chmod+x/etc/rc.d/init.d/php-fpm# 设置开机启动 chkconfigphp-fpmon# 启动/etc/init.d/php-fpmstart 停止/etc/init.d/php-fpmstop 重启/etc/init.d/php-fpmrestart



Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

11 Best PHP URL Shortener Scripts (Free and Premium) 11 Best PHP URL Shortener Scripts (Free and Premium) Mar 03, 2025 am 10:49 AM

11 Best PHP URL Shortener Scripts (Free and Premium)

Introduction to the Instagram API Introduction to the Instagram API Mar 02, 2025 am 09:32 AM

Introduction to the Instagram API

Working with Flash Session Data in Laravel Working with Flash Session Data in Laravel Mar 12, 2025 pm 05:08 PM

Working with Flash Session Data in Laravel

Build a React App With a Laravel Back End: Part 2, React Build a React App With a Laravel Back End: Part 2, React Mar 04, 2025 am 09:33 AM

Build a React App With a Laravel Back End: Part 2, React

Simplified HTTP Response Mocking in Laravel Tests Simplified HTTP Response Mocking in Laravel Tests Mar 12, 2025 pm 05:09 PM

Simplified HTTP Response Mocking in Laravel Tests

cURL in PHP: How to Use the PHP cURL Extension in REST APIs cURL in PHP: How to Use the PHP cURL Extension in REST APIs Mar 14, 2025 am 11:42 AM

cURL in PHP: How to Use the PHP cURL Extension in REST APIs

12 Best PHP Chat Scripts on CodeCanyon 12 Best PHP Chat Scripts on CodeCanyon Mar 13, 2025 pm 12:08 PM

12 Best PHP Chat Scripts on CodeCanyon

Notifications in Laravel Notifications in Laravel Mar 04, 2025 am 09:22 AM

Notifications in Laravel

See all articles