Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the startup methods in php-fpm

2025-04-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly shows you "what are the startup methods in php-fpm", the content is simple and clear, and I hope it can help you solve your doubts. Let me lead you to study and learn this article "what are the startup methods in php-fpm".

Various startup methods of php-fpm:

The easiest operation to start php-fpm is:

/ usr/local/php/sbin/php-fpm

Php-fpm after php 5.3.3 no longer supports commands such as / usr/local/php/sbin/php-fpm (start | stop | reload) that php-fpm used to have, so don't look at such old commands, you need to use signal control:

The master process can understand the following signals:

INT, TERM is terminated immediately.

QUIT smooth termination

USR1 reopens the log file

USR2 smoothly reloads all worker processes and reloads configuration and binary modules

A simple and straightforward restart method:

Check the master process number of php-fpm first.

[root@test ~] # ps-ef | grep php-fpmroot 27556 1 0 15:57? 00:00:00 php-fpm: master process (/ usr/local/php/etc/php-fpm.conf) www 27557 27556 15:57? 00:00:00 php-fpm: pool www www 27558 27556 0 15:57? 00:00:00 php-fpm: pool www www 27559 27556 0 15:57? 00:00:00 php-fpm: pool www www 27560 27556 0 15:57? 00:00:00 php-fpm: pool www root 27733 26938 0 16:35 pts/0 00:00:00 grep php-fpm

Restart php-fpm:

Kill-USR2 27556

That's OK. [recommended: PHP video tutorial]

The above scenario is generally used when no php-fpm.pid file is generated. If you want to generate php-fpm.pid, use the following scenario:

As you can see from the master process above, matster uses the configuration file / usr/local/php/etc/php-fpm.conf, and cat / usr/local/php/etc/php-fpm.conf finds:

[global]; Pid file; Note: the default prefix is / usr/local/php/var; Default Value: none;pid = run/php-fpm.pid

The path of the pid file should be located in / usr/local/php/var/run/php-fpm.pid. It was not generated because it was commented out. If we remove the comments and restart php-fpm with kill-USR2 42891, the pid file will be generated. Next time, you can restart and close php-fpm using the following command:

Php-fpm shuts down:

Kill-INT 'cat / usr/local/php/var/run/php-fpm.pid'

Php-fpm restart:

Kill-USR2 'cat / usr/local/php/var/run/php-fpm.pid' are all the contents of this article entitled "what are the startup modes in php-fpm?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report