Php-fpm executable file garbled solution-php Tutorial

Source: Internet
Author: User
Php-fpm executable file garbled solution

  1. Cp/usr/local/php/etc/php-fpm.conf.default->/usr/local/php/etc/php-fpm.conf

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

Create fpm startup service vi/etc/init. d/php-fpm and save

  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

Subsequent steps: add the execution permission chmod + x/etc/rc. d/init. d/php-fpm # set to start chkconfigphp-fpmon # Start/etc/init. d/php-fpmstart stop/etc/init. d/php-fpmstop restart/etc/init. d/php-fpmrestart

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.