{"id":20762,"date":"2017-08-22T17:14:21","date_gmt":"2017-08-22T22:14:21","guid":{"rendered":"http:\/\/www.multitech.net\/developer\/?page_id=20762"},"modified":"2019-09-04T22:22:00","modified_gmt":"2019-09-05T03:22:00","slug":"php-fpm","status":"publish","type":"page","link":"https:\/\/www.multitech.net\/developer\/software\/mlinux\/using-mlinux\/php-fpm\/","title":{"rendered":"Php-fpm (New fast CGI server)"},"content":{"rendered":"<h3><strong style=\"font-size: 1.17em;\">For mLinux versions 4.0 and higher:<\/strong><\/h3>\n<p>In\u00a0mLinux<sup>\u2122<\/sup> 4, the php-fpm server module is the new Fast CGI server. It has better performance than the old fast-cgi serever.<\/p>\n<p>\/etc\/lighttpd.conf now has a section for php-fpm, which is the new fast-cgi server.<\/p>\n<p>Add the mod_fastcgi server module to lighttpd by uncommenting mod_fastcgi:<\/p>\n<pre>server.modules              = (\r\n...\r\n#                               \"mod_setenv\",                                  \r\n#                               \"mod_fastcgi\",                                 \r\n#                               \"mod_proxy\",<\/pre>\n<p>Uncomment the following section (this is new):<\/p>\n<pre>#fastcgi.server             = ( \".php\" =&gt;                                      \r\n#                               ( \"localhost\" =&gt;                               \r\n#                                 (                                            \r\n#                                   \"socket\" =&gt; \"\/var\/run\/php-fpm.socket\",     \r\n#                                   \"broken-scriptfilename\" =&gt; \"enable\"        \r\n#                                 )                                            \r\n#                               )                                              \r\n#                            )<\/pre>\n<p>Activate the php-fpm server by changing\u00a0<i>no<\/i>\u00a0to\u00a0<i>yes<\/i>\u00a0in \/etc\/default\/php-fpm:<\/p>\n<pre># set to \"yes\" or \"no\" to control starting on boot\r\nENABLED=\"yes\"<\/pre>\n<p>Create a test example \/www\/pages\/hello.php:<\/p>\n<pre>&lt;html&gt;&lt;body&gt;\r\n&lt;h1&gt;It Works!&lt;\/h1&gt;\r\n&lt;h2&gt;\r\n&lt;?php\r\necho \"It works php\";\r\n?&gt;\r\n&lt;\/h2&gt;\r\n&lt;\/body&gt;&lt;\/html&gt;<\/pre>\n<p>Restart the servers:<\/p>\n<pre>mtcdt:~$ sudo \/etc\/init.d\/lighttpd restart\r\nPassword: \r\nRestarting Lighttpd Web Server: stopped \/usr\/sbin\/lighttpd (pid 1835)\r\nlighttpd.\r\nmtcdt:~$ sudo \/etc\/init.d\/php-fpm restart \r\nGracefully shutting down php-fpm . done\r\nStarting php-fpm  done<\/pre>\n<p>In a browser, enter the IP and name of the PHP file:<\/p>\n<pre>http:\/\/192.168.2.1\/hello.php<\/pre>\n<p>You should see:<\/p>\n<pre>It Works!\r\nIt works php<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>For mLinux versions 4.0 and higher: In\u00a0mLinux\u2122 4, the php-fpm server module is the new Fast CGI server. It has better performance than the old fast-cgi serever. \/etc\/lighttpd.conf now has a section for php-fpm, which is the new fast-cgi server. Add the mod_fastcgi server module to lighttpd by uncommenting mod_fastcgi: server.modules = ( &#8230; # [&hellip;]<\/p>\n","protected":false},"author":1478,"featured_media":0,"parent":9184,"menu_order":17,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"class_list":["post-20762","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/20762","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/users\/1478"}],"replies":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/comments?post=20762"}],"version-history":[{"count":10,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/20762\/revisions"}],"predecessor-version":[{"id":28586,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/20762\/revisions\/28586"}],"up":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/9184"}],"wp:attachment":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/media?parent=20762"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}