Author: pierre
Date: Sat Mar 29 03:19:25 2014
New Revision: 12909

Log:
Use the fastCGI process manager for PHP. Fixes ticket #4844

Modified:
   trunk/BOOK/general/prog/php.xml
   trunk/BOOK/introduction/welcome/changelog.xml

Modified: trunk/BOOK/general/prog/php.xml
==============================================================================
--- trunk/BOOK/general/prog/php.xml     Sat Mar 29 03:04:11 2014        (r12908)
+++ trunk/BOOK/general/prog/php.xml     Sat Mar 29 03:19:25 2014        (r12909)
@@ -179,8 +179,12 @@
 <screen><userinput>sed -i -e 's/2.6.5 2.7/&amp; 3.0/' configure &amp;&amp;
 ./configure --prefix=/usr                \
             --sysconfdir=/etc            \
+            --localstatedir=/var         \
+            --datadir=/usr/share/php     \
             --mandir=/usr/share/man      \
-            --with-apxs2                 \
+            --enable-fpm                 \
+            --with-fpm-user=apache       \
+            --with-fpm-group=apache      \
             --with-config-file-path=/etc \
             --with-zlib                  \
             --enable-bcmath              \
@@ -204,6 +208,7 @@
 
 <screen role="root"><userinput>make install                                    
     &amp;&amp;
 install -v -m644 php.ini-production /etc/php.ini     &amp;&amp;
+mv -v /etc/php-fpm.conf{.default,}                   &amp;&amp;
 
 install -v -m755 -d /usr/share/doc/php-&php-version; &amp;&amp;
 install -v -m644    CODING_STANDARDS EXTENSIONS INSTALL NEWS README* 
UPGRADING* php.gif \
@@ -242,8 +247,12 @@
       <filename>configure</filename> accept the version 3.0 of 
       <application>Bison</application> as a valid version.</para>
       
-      <para><parameter>--with-apxs2</parameter>: This parameter
-      builds the Apache HTTPD 2.0 module.</para>
+      <para><parameter>--with-datadir=/usr/share/php</parameter>: This works
+      around a bug in the build machinery, which installs some data to a
+      wrong location.</para>
+
+      <para><parameter>--enable-fpm</parameter>: This parameter allows
+      building the fastCGI Process Manager.</para>
 
       <para><parameter>--with-config-file-path=/etc</parameter>: This parameter
       makes <application>PHP</application> look for the
@@ -281,6 +290,13 @@
       allows building PHP without <application>libxml2</application>
       installed.</para>
 
+      <para><option>--with-apxs2</option>: Instead of building the fastCGI 
process
+      manager, it is possible to build an <application>apache</application> 
module.
+      This has some performance penalty for heavy loaded servers, but may be 
easier
+      to set up. This switch is incompatible with the
+      <parameter>--enable-fpm</parameter> and 
<parameter>--with-fpm-...</parameter>
+      switches.</para>
+
   </sect2>
 
   <sect2 role="configuration">
@@ -289,8 +305,9 @@
     <sect3 id="php-config">
       <title>Config Files</title>
 
-      <para><filename>/etc/php.ini</filename> and
-      <filename>/etc/pear.conf</filename></para>
+      <para><filename>/etc/php.ini</filename>,
+      <filename>/etc/pear.conf</filename> and
+      <filename>/etc/php-fpm.conf</filename></para>
 
       <indexterm zone="php php-config">
         <primary sortas="e-etc-php.ini">/etc/php.ini</primary>
@@ -300,6 +317,10 @@
         <primary sortas="e-etc-pear.conf">/etc/pear.conf</primary>
       </indexterm>
 
+      <indexterm zone="php php-config">
+        <primary sortas="e-etc-php-fpm.conf">/etc/php-fpm.conf</primary>
+      </indexterm>
+
     </sect3>
 
     <sect3>
@@ -324,15 +345,24 @@
 <screen role="root"><userinput>sed -i 's@php/includes"@&amp;\ninclude_path = 
".:/usr/lib/php"@' \
     /etc/php.ini</userinput></screen>
 
-      <para>To enable PHP support in the <application>Apache</application>
-      web server, a new LoadModule (which should be handled automatically by 
the
-      <command>make install</command> command) and AddType directives
-      must be added to the <filename>httpd.conf</filename> file:</para>
+      <para>To enable fastCGI support in the <application>Apache</application>
+      web server, two LoadModule directives must be added to the
+      <filename>httpd.conf</filename> file. They are commented out, so just 
issue the
+      following command as <systemitem class="username">root</systemitem> 
user:</para>
+
+<screen role="root"><userinput>sed -i -e '/proxy_module/s/^#//'      \
+       -e '/proxy_fgci_module/s/^#//' \
+       /etc/httpd/httpd.conf</userinput></screen>
+
+      <para>Those modules accept various <command>ProxyPass</command>
+      directives. One possibility is (as the
+      <systemitem class="username">root</systemitem> user):</para>
+
+<screen role="root"><userinput>echo \
+ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/srv/www/$1 >> \
+/etc/httpd/httpd.conf</userinput></screen>
 
-<screen><literal>LoadModule php5_module lib/apache/libphp5.so
-AddType application/x-httpd-php .php</literal></screen>
-
-      <para>Additionally, it can be useful to add an entry for
+      <para>Additionally, it may be useful to add an entry for
       <filename>index.php</filename> to the DirectoryIndex directive of the
       <filename>httpd.conf</filename> file. Lastly, adding a line to setup the
       <filename class='extension'>.phps</filename> extension to show
@@ -347,6 +377,24 @@
 
     </sect3>
 
+    <sect3  id="php-init">
+      <title>Boot Script</title>
+
+      <para>
+        To automatically start the <command>php-fpm</command> daemon when the
+        system is rebooted, install the
+        <filename>/etc/rc.d/init.d/php</filename> bootscript from the
+        <xref linkend="bootscripts"/> package as the
+        <systemitem class="username">root</systemitem> user:
+      </para>
+
+      <indexterm zone="php php-init">
+        <primary sortas="f-php">php</primary>
+      </indexterm>
+
+<screen role="root"><userinput>make install-php</userinput></screen>
+    </sect3>
+
   </sect2>
 
   <sect2 role="content">
@@ -359,10 +407,10 @@
 
       <seglistitem>
         <seg>pear, peardev, pecl, phar (symlink), phar.phar,
-        php, php-cgi, php-config, and phpize</seg>
-        <seg>libphp5.so Apache module and
-        two under /usr/lib/php/extensions/no-debug-zts-20121212/</seg>
-        <seg>/usr/include/php, /usr/lib/php and
+        php, php-cgi, php-config, php-fpm, and phpize</seg>
+        <seg>dba.so and opcache.so in
+       /usr/lib/php/extensions/no-debug-non-zts-20121212/</seg>
+        <seg>/usr/include/php, /usr/lib/php, /usr/share/php and
         /usr/share/doc/php-&php-version;</seg>
       </seglistitem>
     </segmentedlist>
@@ -393,6 +441,16 @@
           </indexterm>
         </listitem>
       </varlistentry>
+
+      <varlistentry id="php-fpm">
+        <term><command>php-fpm</command></term>
+        <listitem>
+          <para>is the fastCGI process manager for PHP.</para>
+          <indexterm zone="php php-fpm">
+            <primary sortas="b-php-fpm">php-fpm</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
 
     </variablelist>
 

Modified: trunk/BOOK/introduction/welcome/changelog.xml
==============================================================================
--- trunk/BOOK/introduction/welcome/changelog.xml       Sat Mar 29 03:04:11 
2014        (r12908)
+++ trunk/BOOK/introduction/welcome/changelog.xml       Sat Mar 29 03:19:25 
2014        (r12909)
@@ -48,6 +48,10 @@
       <para>March 29th, 2014</para>
       <itemizedlist>
         <listitem>
+          <para>[pierre] - Use the fastCGI process manager for PHP. Fixes
+          <ulink url="&blfs-ticket-root;4844">#4844</ulink>.</para>
+        </listitem>
+        <listitem>
           <para>[fernando] - LibreOffice-4.2.2 additional dependencies. Thanks
           Wayne B. Fixes
           <ulink url="&blfs-ticket-root;4877">#4877</ulink>.</para>
-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-book
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to