In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you how to introduce PHP-FPM to make it easier for nginx to run PHP. I hope you will get something after reading this article. Let's discuss it together.
PHP-FPM is a patch written for the PHP kernel to handle starting, stopping, and restarting FastCGI processes as needed. This is a critical feature because nginx can only interface with PHP through FastCGI. Nginx cannot load all PHP environments into itself like Apache does. Nginx running PHP through FastCGI has obvious advantages over Apache including PHP environments:
◆ has a low memory footprint (because nginx runs alone without loading the entire PHP environment).
◆ easily manages user rights (because PHP can manage different users in your server process).
◆ when PHP crashes, nginx can run as usual.
Its disadvantage is that, by contrast, you need to install and set up mod_php,nginx,PHP and FastCGI. In the past, this kind of installation required adding the spawn-fcgi script from the LightTPD project and then using it to start the FastCGI process. However, there are some problems with this installation: it is fragile (it may not restart normally after the process stops) and the installation method is very cumbersome. After installing and configuring nginx, you also need to download LightTPD, set up the script specifically, set it to start automatically, and make sure it works properly at the same time. If you are used to borrowlism and use mod_php out of the box, it may convince you that nginx is a bad product, especially if you have just upgraded the server to replace the original lean platform.
Use PHP-FPM. This patch embeds FastCGI process management capabilities into PHP. So when you use the FPM patch to compile PHP and select the enalbe-fpm option, nginx will control the start and stop of the PHP process as needed. This saves the previous tedious configuration steps. Of course, it's still a bit cumbersome for website developers who like to save time to manually configure patches and compile PHP code. Now I would like to tell you the surprise of this news: PHP5.4 will include the FPM patch directly into the kernel of the PHP project!
This means that you only need to download PHP to compile. You no longer need to set up enalbe-fpm, no longer need to think about how to synchronize with nginx, and try to adopt the same settings as Apache.
You may have tried to run PHP on the nginx platform and yelled at it. I would like to solemnly suggest to you to try PHP-FPM. Although it still has some problems, it is making progress all the time. In the meantime, you may be able to experience the sudden surprise of a cool toy for children playing on the street.
After reading this article, I believe you have a certain understanding of "how to introduce PHP-FPM to make it easier for nginx to run PHP". If you want to know more about it, welcome to follow the industry information channel, thank you for reading!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.