LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
12
返回列表 发新帖
楼主: Havanna

nginx php php-fpm问题

[复制链接]
发表于 2010-10-3 13:41:10 | 显示全部楼层
Post by Havanna;2114106
早看过了
listen = 127.0.0.1:9000
;listen = /var/run/php-fpm/php-fpm.sock
可以运行
;listen = 127.0.0.1:9000
listen = /var/run/php-fpm/php-fpm.sock
运行不了.....

你可以在listen = /var/run/php-fpm/php-fpm.sock下运行?能贴出你的php-fpm.conf,及其版本吗?


我是在 /tmp/php-cgi.sock 上跑,因为之前用php-cgi的关系
我的/tmp是挂在tmpfs上的
主要就是修改了上面我说过的那些东西

  1. darkwhite@www:~$ ls -ltr /tmp
  2. total 8.0K
  3. srw-rw---- 1 http      http         0 Sep 30 15:39 php-cgi.sock=
复制代码

  1. ;;;;;;;;;;;;;;;;;;;;;
  2. ; FPM Configuration ;
  3. ;;;;;;;;;;;;;;;;;;;;;

  4. ; All relative paths in this configuration file are relative to PHP's install
  5. ; prefix.

  6. ; Include one or more files. If glob(3) exists, it is used to include a bunch of
  7. ; files from a glob(3) pattern. This directive can be used everywhere in the
  8. ; file.
  9. ;include=/etc/php/fpm.d/*.conf

  10. ;;;;;;;;;;;;;;;;;;
  11. ; Global Options ;
  12. ;;;;;;;;;;;;;;;;;;

  13. [global]
  14. ; Pid file
  15. ; Default Value: none
  16. pid = /var/run/php-fpm/php-fpm.pid

  17. ; Error log file
  18. ; Default Value: /var/log/php-fpm.log
  19. ;error_log = /var/log/php-fpm.log

  20. ; Log level
  21. ; Possible Values: alert, error, warning, notice, debug
  22. ; Default Value: notice
  23. ;log_level = notice

  24. ; If this number of child processes exit with SIGSEGV or SIGBUS within the time
  25. ; interval set by emergency_restart_interval then FPM will restart. A value
  26. ; of '0' means 'Off'.
  27. ; Default Value: 0
  28. ;emergency_restart_threshold = 0

  29. ; Interval of time used by emergency_restart_interval to determine when
  30. ; a graceful restart will be initiated.  This can be useful to work around
  31. ; accidental corruptions in an accelerator's shared memory.
  32. ; Available Units: s(econds), m(inutes), h(ours), or d(ays)
  33. ; Default Unit: seconds
  34. ; Default Value: 0
  35. ;emergency_restart_interval = 0

  36. ; Time limit for child processes to wait for a reaction on signals from master.
  37. ; Available units: s(econds), m(inutes), h(ours), or d(ays)
  38. ; Default Unit: seconds
  39. ; Default Value: 0
  40. ;process_control_timeout = 0

  41. ; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
  42. ; Default Value: yes
  43. ;daemonize = yes

  44. ;;;;;;;;;;;;;;;;;;;;
  45. ; Pool Definitions ;
  46. ;;;;;;;;;;;;;;;;;;;;

  47. ; Multiple pools of child processes may be started with different listening
  48. ; ports and different management options.  The name of the pool will be
  49. ; used in logs and stats. There is no limitation on the number of pools which
  50. ; FPM can handle. Your system will tell you anyway :)

  51. ; Start a new pool named 'www'.
  52. [www]

  53. ; The address on which to accept FastCGI requests.
  54. ; Valid syntaxes are:
  55. ;   'ip.add.re.ss:port'    - to listen on a TCP socket to a specific address on
  56. ;                            a specific port;
  57. ;   'port'                 - to listen on a TCP socket to all addresses on a
  58. ;                            specific port;
  59. ;   '/path/to/unix/socket' - to listen on a unix socket.
  60. ; Note: This value is mandatory.
  61. ;listen = 127.0.0.1:9000
  62. ;listen = /var/run/php-fpm/php-fpm.sock
  63. listen = /tmp/php-cgi.sock
  64. ; Set listen(2) backlog. A value of '-1' means unlimited.
  65. ; Default Value: -1
  66. ;listen.backlog = -1

  67. ; List of ipv4 addresses of FastCGI clients which are allowed to connect.
  68. ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
  69. ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
  70. ; must be separated by a comma. If this value is left blank, connections will be
  71. ; accepted from any ip address.
  72. ; Default Value: any
  73. ;listen.allowed_clients = 127.0.0.1

  74. ; Set permissions for unix socket, if one is used. In Linux, read/write
  75. ; permissions must be set in order to allow connections from a web server. Many
  76. ; BSD-derived systems allow connections regardless of permissions.
  77. ; Default Values: user and group are set as the running user
  78. ;                 mode is set to 0666
  79. listen.owner = http
  80. listen.group = http
  81. listen.mode = 0660

  82. ; Unix user/group of processes
  83. ; Note: The user is mandatory. If the group is not set, the default user's group
  84. ;       will be used.
  85. user = http
  86. group = http

  87. ; Choose how the process manager will control the number of child processes.
  88. ; Possible Values:
  89. ;   static  - a fixed number (pm.max_children) of child processes;
  90. ;   dynamic - the number of child processes are set dynamically based on the
  91. ;             following directives:
  92. ;             pm.max_children      - the maximum number of children that can
  93. ;                                    be alive at the same time.
  94. ;             pm.start_servers     - the number of children created on startup.
  95. ;             pm.min_spare_servers - the minimum number of children in 'idle'
  96. ;                                    state (waiting to process). If the number
  97. ;                                    of 'idle' processes is less than this
  98. ;                                    number then some children will be created.
  99. ;             pm.max_spare_servers - the maximum number of children in 'idle'
  100. ;                                    state (waiting to process). If the number
  101. ;                                    of 'idle' processes is greater than this
  102. ;                                    number then some children will be killed.
  103. ; Note: This value is mandatory.
  104. pm = dynamic

  105. ; The number of child processes to be created when pm is set to 'static' and the
  106. ; maximum number of child processes to be created when pm is set to 'dynamic'.
  107. ; This value sets the limit on the number of simultaneous requests that will be
  108. ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
  109. ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
  110. ; CGI.
  111. ; Note: Used when pm is set to either 'static' or 'dynamic'
  112. ; Note: This value is mandatory.
  113. pm.max_children = 50

  114. ; The number of child processes created on startup.
  115. ; Note: Used only when pm is set to 'dynamic'
  116. ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
  117. pm.start_servers = 3

  118. ; The desired minimum number of idle server processes.
  119. ; Note: Used only when pm is set to 'dynamic'
  120. ; Note: Mandatory when pm is set to 'dynamic'
  121. pm.min_spare_servers = 1

  122. ; The desired maximum number of idle server processes.
  123. ; Note: Used only when pm is set to 'dynamic'
  124. ; Note: Mandatory when pm is set to 'dynamic'
  125. pm.max_spare_servers = 3

  126. ; The number of requests each child process should execute before respawning.
  127. ; This can be useful to work around memory leaks in 3rd ***** libraries. For
  128. ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
  129. ; Default Value: 0
  130. pm.max_requests = 750

  131. ; The URI to view the FPM status page. If this value is not set, no URI will be
  132. ; recognized as a status page. By default, the status page shows the following
  133. ; information:
  134. ;   accepted conn    - the number of request accepted by the pool;
  135. ;   pool             - the name of the pool;
  136. ;   process manager  - static or dynamic;
  137. ;   idle processes   - the number of idle processes;
  138. ;   active processes - the number of active processes;
  139. ;   total processes  - the number of idle + active processes.
  140. ; The values of 'idle processes', 'active processes' and 'total processes' are
  141. ; updated each second. The value of 'accepted conn' is updated in real time.
  142. ; Example output:
  143. ;   accepted conn:   12073
  144. ;   pool:             www
  145. ;   process manager:  static
  146. ;   idle processes:   35
  147. ;   active processes: 65
  148. ;   total processes:  100
  149. ; By default the status page output is formatted as text/plain. Passing either
  150. ; 'html' or 'json' as a query string will return the corresponding output
  151. ; syntax. Example:
  152. ;   http://www.foo.bar/status
  153. ;   http://www.foo.bar/status?json
  154. ;   http://www.foo.bar/status?html
  155. ; Note: The value must start with a leading slash (/). The value can be
  156. ;       anything, but it may not be a good idea to use the .php extension or it
  157. ;       may conflict with a real PHP file.
  158. ; Default Value: not set
  159. pm.status_path = /status.php

  160. ; The ping URI to call the monitoring page of FPM. If this value is not set, no
  161. ; URI will be recognized as a ping page. This could be used to test from outside
  162. ; that FPM is alive and responding, or to
  163. ; - create a graph of FPM availability (rrd or such);
  164. ; - remove a server from a group if it is not responding (load balancing);
  165. ; - trigger alerts for the operating team (24/7).
  166. ; Note: The value must start with a leading slash (/). The value can be
  167. ;       anything, but it may not be a good idea to use the .php extension or it
  168. ;       may conflict with a real PHP file.
  169. ; Default Value: not set
  170. ping.path = /ping

  171. ; This directive may be used to customize the response of a ping request. The
  172. ; response is formatted as text/plain with a 200 response code.
  173. ; Default Value: pong
  174. ;ping.response = pong

  175. ; The timeout for serving a single request after which the worker process will
  176. ; be killed. This option should be used when the 'max_execution_time' ini option
  177. ; does not stop script execution for some reason. A value of '0' means 'off'.
  178. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
  179. ; Default Value: 0
  180. ;request_terminate_timeout = 0

  181. ; The timeout for serving a single request after which a PHP backtrace will be
  182. ; dumped to the 'slowlog' file. A value of '0s' means 'off'.
  183. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
  184. ; Default Value: 0
  185. ;request_slowlog_timeout = 0

  186. ; The log file for slow requests
  187. ; Default Value: /var/log/php-fpm.log.slow
  188. ;slowlog = /var/log/php-fpm.log.slow

  189. ; Set open file descriptor rlimit.
  190. ; Default Value: system defined value
  191. ;rlimit_files = 1024

  192. ; Set max core size rlimit.
  193. ; Possible Values: 'unlimited' or an integer greater or equal to 0
  194. ; Default Value: system defined value
  195. ;rlimit_core = 0

  196. ; Chroot to this directory at the start. This value must be defined as an
  197. ; absolute path. When this value is not set, chroot is not used.
  198. ; Note: chrooting is a great security feature and should be used whenever
  199. ;       possible. However, all PHP paths will be relative to the chroot
  200. ;       (error_log, sessions.save_path, ...).
  201. ; Default Value: not set
  202. ;chroot =

  203. ; Chdir to this directory at the start. This value must be an absolute path.
  204. ; Default Value: current directory or / when chroot
  205. ;chdir = /srv/http

  206. ; Redirect worker stdout and stderr into main error log. If not set, stdout and
  207. ; stderr will be redirected to /dev/null according to FastCGI specs.
  208. ; Default Value: no
  209. ;catch_workers_output = yes

  210. ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
  211. ; the current environment.
  212. ; Default Value: clean env
  213. ;env[HOSTNAME] = $HOSTNAME
  214. ;env[PATH] = /usr/local/bin:/usr/bin:/bin
  215. ;env[TMP] = /tmp
  216. ;env[TMPDIR] = /tmp
  217. ;env[TEMP] = /tmp

  218. ; Additional php.ini defines, specific to this pool of workers. These settings
  219. ; overwrite the values previously defined in the php.ini. The directives are the
  220. ; same as the PHP SAPI:
  221. ;   php_value/php_flag             - you can set classic ini defines which can
  222. ;                                    be overwritten from PHP call 'ini_set'.
  223. ;   php_admin_value/php_admin_flag - these directives won't be overwritten by
  224. ;                                     PHP call 'ini_set'
  225. ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.

  226. ; Defining 'extension' will load the corresponding shared extension from
  227. ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
  228. ; overwrite previously defined php.ini values, but will append the new value
  229. ; instead.

  230. ; Default Value: nothing is defined by default except the values in php.ini and
  231. ;                specified at startup with the -d argument
  232. ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
  233. ;php_flag[display_errors] = off
  234. ;php_admin_value[error_log] = /var/log/fpm-php.www.log
  235. ;php_admin_flag[log_errors] = on
  236. ;php_admin_value[memory_limit] = 32M
复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-10-3 14:37:17 | 显示全部楼层
刚重装了下php-fpm
一切又恢复正常了
^_^ ~ $ ls -lh /var/run/php-fpm/
total 4.0K
-rw-r--r-- 1 root root 4 Oct  3 14:31 php-fpm.pid
srw-rw---- 1 http http 0 Oct  3 14:31 php-fpm.sock

php-fpm配置文件没动.....
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表