php-fpm可執行檔亂碼的解決方案

來源:互聯網
上載者:User
  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. #!/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=$?

  73. *)

  74. echo $"Usage:$prog{start|stop|restart|reload|status|help}"
  75. exit 1
  76. esac
  77. exit $RETVAL

複製代碼

後續操作步驟:添加執行許可權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

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.