{"id":800,"date":"2021-07-23T12:38:28","date_gmt":"2021-07-23T12:38:28","guid":{"rendered":"https:\/\/ssdsunucum.com\/blog\/php-fastcgi-process-manager-php-fpm\/"},"modified":"2021-07-23T12:38:28","modified_gmt":"2021-07-23T12:38:28","slug":"php-fastcgi-process-manager-php-fpm","status":"publish","type":"post","link":"https:\/\/ssdsunucum.com\/blog\/php-fastcgi-process-manager-php-fpm\/","title":{"rendered":"PHP FastCGI Process Manager &#8211; PHP-FPM"},"content":{"rendered":"<\/p>\n<div class=\"col-md-9\">\n<div class=\"flex-column flex-md-row article-header\"><\/div>\n<hr>\n<h2 id=\"overview\">Overview<\/h2>\n<div class=\"callout callout-danger\">\n<div class=\"callout-heading\">Warning:<\/div>\n<div class=\"callout-content\">\n        We <strong>strongly<\/strong> recommend that you only activate Apache PHP-FPM if your server has at least 2 GB of RAM available, or at least 30 MB of RAM per domain. If you enable PHP-FPM on a server with less than the required RAM, your server may experience severe performance issues.\n    <\/div>\n<\/div>\n<p>PHP FastCGI Process Manager (PHP-FPM) is an alternative FastCGI daemon for PHP that allows a website to handle high loads. PHP-FPM maintains pools (workers that can respond to PHP requests) to accomplish this. PHP-FPM is faster than traditional CGI-based methods, such as SUPHP, for multi-user PHP environments. It does <strong>not<\/strong> overload a system\u2019s memory with PHP from Apache processes.<\/p>\n<ul>\n<li>LiteSpeed Web Server uses the <code>lsphp<\/code> binary. LiteSpeed Web Server does <strong>not<\/strong> use the system\u2019s PHP-FPM implementation in WHM\u2019s <em>MultiPHP Manager<\/em> interface <em>(WHM &gt;&gt; Home &gt;&gt; Software &gt;&gt; MultiPHP Manager)<\/em>.<\/li>\n<li>To monitor applications that use PHP-FPM, select the <em>Monitor<\/em> checkbox for the <em>PHP-FPM service for cPanel Daemons<\/em> service in WHM\u2019s <em>Service Manager<\/em> interface <em>(WHM &gt;&gt; Home &gt;&gt; Service Configuration &gt;&gt; Service Manager)<\/em>.<\/li>\n<\/ul>\n<h2 id=\"running-php-fpm-with-centos-7-centos-8-or-almalinux-8-and-easyapache-4\">Running PHP-FPM with CentOS 7, CentOS 8, or AlmaLinux 8 and EasyApache 4<\/h2>\n<p>On CentOS 7, CentOS 8, and AlmaLinux 8 systems, EasyApache 4 uses the <code>PrivateTmp<\/code> option with PHP-FPM. EasyApache 4 does this to increase security for temporary files that the running processes in PHP-FPM access. The <code>PrivateTmp<\/code> option creates special directories in the <code>\/tmp<\/code> directory for each Apache PHP-FPM version your system uses. It\u2019s possible that each time you or the system restarts the PHP-FPM service, the <code>PrivateTmp<\/code> option will create a new directory.<\/p>\n<div class=\"callout callout-danger\">\n<div class=\"callout-heading\">Warning:<\/div>\n<div class=\"callout-content\">\n<p>Removing the <code>PrivateTmp<\/code>-created directories, either manually or automatically, will cause errors in applications or websites that use PHP-FPM. We <strong>strongly<\/strong> encourage that you do <strong>not<\/strong> remove these directories. If you need to remove any of these directories, we recommend that you restart the Apache PHP-FPM service. This ensures that Apache PHP-FPM will work correctly.<\/p>\n<p>To restart Apache PHP-FPM, use the following command:<\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\">scripts\/restartsrv_apache_php_fpm --hard<\/code><\/pre>\n<\/div><\/div>\n<\/div>\n<h2 id=\"tutorials-on-how-to-use-php-fpm\">Tutorials on how to use PHP-FPM<\/h2>\n<ul>\n<li>Configuration Values of PHP-FPM \u2014 This document lists the cPanel PHP-FPM system\u2019s configuration settings and their default values.<\/li>\n<li>PHP-FPM Code and FileSystem Layout for EasyApache4 \u2014 This document explains how to implement PHP-FPM, the filesystem layout of PHP-FPM, and how to adjust PHP versions.<\/li>\n<li>The <code>php_fpm_config<\/code> Script \u2014 This document explains when and how to use the <code>\/scripts\/php_fpm_config<\/code> script.<\/li>\n<li>PHP-FPM Domain Pools \u2013 This document explains how to create a domain pool with PHP-FPM.<\/li>\n<\/ul><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Overview Warning: We strongly recommend that you only activate Apache PHP-FPM if your server has at least 2 GB of RAM available, or at least 30 MB of RAM per domain. If you enable PHP-FPM on a server with less than the required RAM, your server may experience severe performance issues. PHP FastCGI Process Manager &hellip;<\/p>\n","protected":false},"author":1,"featured_media":801,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/800"}],"collection":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/comments?post=800"}],"version-history":[{"count":0,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/800\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media\/801"}],"wp:attachment":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media?parent=800"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/categories?post=800"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/tags?post=800"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}