source: general/prog/php.xml@ 277c34cf

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 9.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 277c34cf was 277c34cf, checked in by Bruce Dubbs <bdubbs@…>, 5 years ago

Update to Net-DNS-1.21 (Perl Module).
Update to logrotate-3.15.1.
Update to php-7.3.9.
Update to links-2.20.1.
Update to emacs-26.3.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@22099 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 24.6 KB
RevLine 
[08254fc]1<?xml version="1.0" encoding="ISO-8859-1"?>
[6732c094]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
[08254fc]4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
[577eb27]7 <!ENTITY php-download-http "http://www.php.net/distributions/php-&php-version;.tar.xz">
[0c54cea]8 <!ENTITY php-download-ftp " ">
[277c34cf]9 <!ENTITY php-md5sum "9063f6d55bdf09e494001bed9de54203">
[d996cdb5]10 <!ENTITY php-size "12 MB">
[277c34cf]11 <!ENTITY php-buildsize "581 MB (add 2 MB for tests, add 112 MB for documentation)">
[cd1e903]12 <!ENTITY php-time "1.9 SBU (with parallelism=4; add 2.6 SBU for tests)">
[08254fc]13]>
14
[6683a00]15<sect1 id="php" xreflabel="PHP-&php-version;">
[db81e4cb]16 <?dbhtml filename="php.html"?>
17
18 <sect1info>
19 <othername>$LastChangedBy$</othername>
20 <date>$Date$</date>
21 </sect1info>
22
23 <title>PHP-&php-version;</title>
24
25 <indexterm zone="php">
26 <primary sortas="a-PHP">PHP</primary>
27 </indexterm>
28
29 <sect2 role="package">
30 <title>Introduction to PHP</title>
31
[577eb27]32 <para>
33 <application>PHP</application> is the PHP Hypertext Preprocessor.
34 Primarily used in dynamic web sites, it allows for programming code to be
35 directly embedded into the HTML markup. It is also useful as a
36 general purpose scripting language.
37 </para>
[a5db8d2]38
[1ab21f7]39 &lfs90_checked;
[db81e4cb]40
41 <bridgehead renderas="sect3">Package Information</bridgehead>
42 <itemizedlist spacing="compact">
43 <listitem>
[577eb27]44 <para>
45 Download (HTTP): <ulink url="&php-download-http;"/>
46 </para>
[db81e4cb]47 </listitem>
48 <listitem>
[577eb27]49 <para>
50 Download (FTP): <ulink url="&php-download-ftp;"/>
51 </para>
[db81e4cb]52 </listitem>
53 <listitem>
[577eb27]54 <para>
55 Download MD5 sum: &php-md5sum;
56 </para>
[db81e4cb]57 </listitem>
58 <listitem>
[577eb27]59 <para>
60 Download size: &php-size;
61 </para>
[db81e4cb]62 </listitem>
63 <listitem>
[577eb27]64 <para>
65 Estimated disk space required: &php-buildsize;
66 </para>
[db81e4cb]67 </listitem>
68 <listitem>
[577eb27]69 <para>
70 Estimated build time: &php-time;
71 </para>
[db81e4cb]72 </listitem>
73 </itemizedlist>
74
75 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
76 <itemizedlist spacing="compact">
[b84326b7]77 <listitem>
[577eb27]78 <para>
[1e5323fd]79 Optional pre-built documentation (single file html): <ulink
80 url="https://www.php.net/distributions/manual/php_manual_en.html.gz"/>
81 </para>
82 </listitem>
83 <listitem>
84 <para>
85 Optional pre-built documentation (chunked html): <ulink
86 url="https://www.php.net/distributions/manual/php_manual_en.tar.gz"/>.
87 Note that the documentation can be found in languages other than
88 English at <ulink url="http://www.php.net/download-docs.php"/>
[577eb27]89 </para>
[b84326b7]90 </listitem>
[db81e4cb]91 </itemizedlist>
92
93 <bridgehead renderas="sect3">PHP Dependencies</bridgehead>
94
[2f65edb]95 <bridgehead renderas="sect4">Recommended</bridgehead>
[2e4782e]96 <para role="recommended">
97 <xref linkend="apache"/> and
98 <xref linkend="libxml2"/>
99 </para>
[2f65edb]100
[b84326b7]101 <bridgehead renderas="sect4">Optional System Utilities and Libraries</bridgehead>
[577eb27]102 <para role="optional">
103 <xref linkend="aspell"/>,
104 <xref linkend="enchant"/>,
[604bf744]105 <xref linkend="libxslt"/>,
[577eb27]106 an <xref linkend="server-mail"/> (that provides a
[604bf744]107 <command>sendmail</command> command),
108 <xref linkend="pcre"/>,
109 <xref linkend="pth"/>,
[c93c9bf4]110 <ulink url="https://wiki.ubuntu.com/AppArmor">AppArmor</ulink>,
[604bf744]111 <ulink url="http://dmalloc.com/">Dmalloc</ulink>,
[577eb27]112 <ulink url="http://www.net-snmp.org/">Net-SNMP</ulink>,
[604bf744]113 <ulink url="http://www.ossp.org/pkg/lib/mm/">OSSP mm</ulink>,
114 <ulink url="http://re2c.org/">re2c</ulink>, and
115 <ulink url="http://xmlrpc-epi.sourceforge.net/main.php?t=php_about">XMLRPC-EPI</ulink>
[577eb27]116 </para>
[b84326b7]117
118 <bridgehead renderas="sect4">Optional Graphics Utilities and Libraries</bridgehead>
[577eb27]119 <para role="optional">
[604bf744]120 <xref linkend="freetype2"/>,
121 <xref linkend="libexif"/>,
[577eb27]122 <xref linkend="libjpeg"/>,
123 <xref linkend="libpng"/>,
[604bf744]124 <xref linkend="libtiff"/>,
[577eb27]125 <xref linkend="x-window-system"/>,
[b8efb1fb]126 <!--<ulink url="http://www.fastio.com/">ClibPDF</ulink>, - site asks for username/password-->
[604bf744]127 <ulink url="http://www.adobe.com/devnet/acrobat/fdftoolkit.html">FDF Toolkit</ulink>,
[c93c9bf4]128 <ulink url="https://github.com/libgd/libgd">GD</ulink>, and
[59d1550]129 <ulink url="http://fossies.org/linux/misc/old/t1lib-5.1.2.tar.gz/">t1lib</ulink>
[577eb27]130 </para>
[b84326b7]131
132 <bridgehead renderas="sect4">Optional Web Utilities</bridgehead>
[577eb27]133 <para role="optional">
134 <xref linkend="curl"/>,
[2b65035a]135 <xref linkend="tidy-html5"/>,
[604bf744]136 <ulink url="http://sourceforge.net/projects/caudium/">Caudium</ulink>,
[bd86aa8]137 <ulink url="https://www.hyperwave.com/en/">Hyperwave</ulink>,
[604bf744]138 <ulink url="http://www.mnogosearch.org/">mnoGoSearch</ulink>,
[c93c9bf4]139 <ulink url="http://download.roxen.com/6.1/">Roxen WebServer</ulink>, and
[577eb27]140 <ulink url="https://wddxnet.codeplex.com/">WDDX</ulink>
141 </para>
[b84326b7]142
143 <bridgehead renderas="sect4">Optional Data Management Utilities and Libraries</bridgehead>
[577eb27]144 <para role="optional">
[3dda7b8]145 <xref linkend="db"/> (Note that PHP does not officially support versions
[c93c9bf4]146 above 5.3),
147 <xref linkend="libiodbc"/>,
148 <xref linkend="lmdb"/>,
[577eb27]149 <xref linkend="mariadb"/> or <ulink url="http://www.mysql.com/">MySQL</ulink>,
[604bf744]150 <xref linkend="openldap"/>,
[577eb27]151 <xref linkend="postgresql"/>,
152 <xref linkend="sqlite"/>,
[604bf744]153 <xref linkend="unixodbc"/>,
154 <ulink url="http://www.softwareag.com/">Adabas</ulink>,
[577eb27]155 <ulink url="http://www.birdstep.com/">Birdstep</ulink>,
[604bf744]156 <ulink url="http://cr.yp.to/cdb.html">cdb</ulink>,
[577eb27]157 <ulink url="http://www.dbmaker.com/">DBMaker</ulink>,
[604bf744]158 <ulink url="http://www.empress.com/">Empress</ulink>,
[b8efb1fb]159 <ulink url="http://www.frontbase.com/cgi-bin/WebObjects/FBWebSite">FrontBase</ulink>,
[c93c9bf4]160 <ulink url="https://www.ibm.com/analytics/us/en/db2/">IBM DB2</ulink>,
[604bf744]161 <ulink url="http://www.hughes.com.au/products/msql/">Mini SQL</ulink>,
162 <ulink url="http://www.monetra.com/">Monetra</ulink>, and
163 <ulink url="http://sourceforge.net/projects/qdbm">QDBM</ulink>
[577eb27]164 </para>
165
166 <para>
167 <application>PHP</application> also provides support for many
168 commercial database tools such as <application>Oracle</application>,
169 <application>SAP</application> and
170 <application>ODBC Router</application>.
171 </para>
[e797436]172
[b84326b7]173 <bridgehead renderas="sect4">Optional Security/Encryption Utilities and Libraries</bridgehead>
[577eb27]174 <para role="optional">
175 <xref linkend="cyrus-sasl"/>,
176 <xref linkend="mitkrb"/>,
177 <ulink url="http://mcrypt.sourceforge.net/">libmcrypt</ulink>, and
178 <ulink url="http://mhash.sourceforge.net/">mhash</ulink>
179 </para>
[db81e4cb]180
[577eb27]181 <para condition="html" role="usernotes">
182 User Notes: <ulink url="&blfs-wiki;/php"/>
183 </para>
[1039de3]184
[db81e4cb]185 </sect2>
186
187 <sect2 role="installation">
188 <title>Installation of PHP</title>
189
[577eb27]190 <para>
191 You can use <application>PHP</application> for server-side
192 scripting, command-line scripting or client-side GUI applications. This
193 book provides instructions for setting up <application>PHP</application>
194 for server-side scripting as it is the most common form.
195 </para>
[db81e4cb]196
[b84326b7]197 <note>
[577eb27]198 <para>
199 <application>PHP</application> has many more
200 <command>configure</command> options that will enable support for
201 various things. You can use <command>./configure --help</command> to
202 see a full list of the available options. Also, use of the
203 <ulink url="http://www.php.net/">PHP web site</ulink>
204 is highly recommended, as their online docs are very good. An example
205 of a <command>configure</command> command that utilizes many of the
206 most common dependencies can be found at <ulink
[a29486e4]207 url="&sources-anduin-http;/files/php_configure.txt"/>.
[e797436]208 </para>
[3f87e4a]209
[577eb27]210 <para>
211 If, for whatever reason, you don't have <xref linkend="libxml2"/>
212 installed, you need to add <option>--disable-libxml</option> to the
213 <command>configure</command> command in the instructions below. Note
214 that this will prevent the <command>pear</command> command from being
215 built.
216 </para>
[b84326b7]217 </note>
[3cf45b8]218<!--
[b8efb1fb]219 <para>
220 If you wish to build <application>PHP</application> with the
221 <application>tidy-html5</application> library, due to API changes, in the
222 <application>PHP</application> source, <filename>buffio.h</filename>
223 header needs to be changed to <filename>tidybuffio.h</filename> in the
224 file <filename>ext/tidy/tidy.c</filename>:
225 </para>
226
[3bbde8b5]227<screen><userinput>sed -i 's/buffio.h/tidy&amp;/' ext/tidy/tidy.c</userinput></screen>
[3cf45b8]228-->
[577eb27]229 <para>
230 Install <application>PHP</application> by running the following commands:
231 </para>
[db81e4cb]232
[0098ace6]233<screen revision="sysv"><userinput>./configure --prefix=/usr \
[75033b6]234 --sysconfdir=/etc \
[5178bbf6]235 --localstatedir=/var \
236 --datadir=/usr/share/php \
[81b5be3]237 --mandir=/usr/share/man \
[c0764bc]238 --without-pear \
[5178bbf6]239 --enable-fpm \
240 --with-fpm-user=apache \
241 --with-fpm-group=apache \
[4a93a3c]242 --with-config-file-path=/etc \
[75033b6]243 --with-zlib \
244 --enable-bcmath \
245 --with-bz2 \
246 --enable-calendar \
247 --enable-dba=shared \
248 --with-gdbm \
249 --with-gmp \
250 --enable-ftp \
251 --with-gettext \
252 --enable-mbstring \
253 --with-readline &amp;&amp;
[db81e4cb]254make</userinput></screen>
255
[0098ace6]256<screen revision="systemd"><userinput>./configure --prefix=/usr \
257 --sysconfdir=/etc \
258 --localstatedir=/var \
259 --datadir=/usr/share/php \
260 --mandir=/usr/share/man \
261 --enable-fpm \
[c0764bc]262 --without-pear \
[0098ace6]263 --with-fpm-user=apache \
264 --with-fpm-group=apache \
265 --with-fpm-systemd \
266 --with-config-file-path=/etc \
267 --with-zlib \
268 --enable-bcmath \
269 --with-bz2 \
270 --enable-calendar \
271 --enable-dba=shared \
272 --with-gdbm \
273 --with-gmp \
274 --enable-ftp \
275 --with-gettext \
276 --enable-mbstring \
277 --with-readline &amp;&amp;
278make</userinput></screen>
[577eb27]279 <para>
280 To test the results, issue: <command>make test</command>. A few
281 tests may fail, in which case you are asked whether you want to send
[6dce48a]282 the report to the PHP developers. If you want to automate the test,
[577eb27]283 you may prefix the command with <command>yes "n" | </command>.
284 </para>
[d6f7e6cb]285
[577eb27]286 <para>
287 Now, as the <systemitem class="username">root</systemitem> user:
288 </para>
[db81e4cb]289
[81b5be3]290<!-- dev note: make INSTALL_ROOT=<DESTDIR> install -->
291
[595e58e]292<screen role="root"><userinput>make install &amp;&amp;
293install -v -m644 php.ini-production /etc/php.ini &amp;&amp;
[d6f7e6cb]294
[ba1a38b]295install -v -m755 -d /usr/share/doc/php-&php-version; &amp;&amp;
[75033b6]296install -v -m644 CODING_STANDARDS EXTENSIONS INSTALL NEWS README* UPGRADING* php.gif \
[5a464e4d]297 /usr/share/doc/php-&php-version; &amp;&amp;
298ln -v -sfn /usr/lib/php/doc/Archive_Tar/docs/Archive_Tar.txt \
299 /usr/share/doc/php-&php-version; &amp;&amp;
300ln -v -sfn /usr/lib/php/doc/Structures_Graph/docs \
301 /usr/share/doc/php-&php-version;</userinput></screen>
[db81e4cb]302
[6ca1b179]303 <para>
304 The default configuration files for the fastCGI process manager are
[0639bb6]305 installed only if they do not already exist on the system. If this is
[6ca1b179]306 the first installation, they should be renamed, as the
307 <systemitem class='username'>root</systemitem> user:
308 </para>
309
310<screen role="root"><userinput>if [ -f /etc/php-fpm.conf.default ]; then
311 mv -v /etc/php-fpm.conf{.default,} &amp;&amp;
312 mv -v /etc/php-fpm.d/www.conf{.default,}
313fi</userinput></screen>
314
[577eb27]315 <para>
316 The pre-built HTML documentation is packaged in two forms: a tarball
317 containing many individual files, useful for quick loading into your
318 browser, and one large individual file, which is useful for using the
319 search utility of your browser. If you downloaded either, or both, of the
320 documentation files, issue the following commands as the
321 <systemitem class='username'>root</systemitem> user to install them (note
322 these instructions assume English docs, modify the tarball names below if
323 necessary).
324 </para>
[db81e4cb]325
[577eb27]326 <para>
327 For the <quote>Single HTML</quote> file:
328 </para>
[b84326b7]329
330<screen role="root"><userinput>install -v -m644 ../php_manual_en.html.gz \
331 /usr/share/doc/php-&php-version; &amp;&amp;
332gunzip -v /usr/share/doc/php-&php-version;/php_manual_en.html.gz</userinput></screen>
333
[577eb27]334 <para>
335 For the <quote>Many HTML files</quote> tarball:
336 </para>
[b84326b7]337
[0fb9d5f]338<screen role="root"><userinput>tar -xvf ../php_manual_en.tar.gz \
[a5db8d2]339 -C /usr/share/doc/php-&php-version; --no-same-owner</userinput></screen>
[db81e4cb]340
[c0764bc]341 <para>
342 The bundled pear is not installed because of a bug which might
343 pollute the filesystem with several hidden files and directories.
[1e5323fd]344 If pear is needed, execute the following commands to install it:
[c0764bc]345 </para>
346
347<screen role="nodump"><userinput>wget http://pear.php.net/go-pear.phar
348php ./go-pear.phar</userinput></screen>
349
[db81e4cb]350 </sect2>
[b84326b7]351
[934c9b26]352 <sect2 role="commands">
[577eb27]353 <title>Command Explanations</title>
[c93c9bf4]354<!-- Seems to be obsolete?
[0098ace6]355 <para revision="systemd">
356 <command>sed -i "s|lsystemd-daemon|lsystemd|g" configure</command>:
357 This command fixes the detection of the systemd library.
358 </para>
[c93c9bf4]359-->
[577eb27]360 <para>
[f1d7196]361 <parameter>--datadir=/usr/share/php</parameter>: This works
[577eb27]362 around a bug in the build machinery, which installs some data to a
363 wrong location.
364 </para>
[5178bbf6]365
[577eb27]366 <para>
367 <parameter>--enable-fpm</parameter>: This parameter allows
368 building the fastCGI Process Manager.
369 </para>
[934c9b26]370
[0098ace6]371 <para revision="systemd">
372 <parameter>--with-fpm-systemd</parameter>: This parameter allows
373 the FastCGI Process Manager to integrate with systemd.
374 </para>
375
[c0764bc]376 <para>
377 <parameter>--without-pear</parameter>: This switch disables
378 installation of bundled pear software.
379 </para>
380
[577eb27]381 <para>
382 <parameter>--with-config-file-path=/etc</parameter>: This parameter
383 makes <application>PHP</application> look for the
384 <filename>php.ini</filename> configuration file in
385 <filename class='directory'>/etc</filename>.
386 </para>
[934c9b26]387
[577eb27]388 <para>
389 <parameter>--with-zlib</parameter>: This parameter adds
390 support for <application>Zlib</application> compression.
391 </para>
[934c9b26]392
[577eb27]393 <para>
394 <parameter>--enable-bcmath</parameter>: Enables
395 <command>bc</command> style precision math functions.
396 </para>
[bccbdaea]397
[577eb27]398 <para>
399 <parameter>--with-bz2</parameter>: Adds support for
400 <application>Bzip2</application> compression functions.
401 </para>
[934c9b26]402
[577eb27]403 <para>
404 <parameter>--enable-calendar</parameter>: This parameter
405 provides support for calendar conversion.
406 </para>
[934c9b26]407
[577eb27]408 <para>
409 <parameter>--enable-dba=shared</parameter>: This parameter enables
410 support for database (dbm-style) abstraction layer functions.
411 </para>
[934c9b26]412
[577eb27]413 <para>
414 <parameter>--enable-ftp</parameter>: This parameter
415 enables FTP functions.
416 </para>
[934c9b26]417
[577eb27]418 <para>
419 <parameter>--with-gettext</parameter>: Enables functions
420 that use <application>Gettext</application> text translation.
421 </para>
[934c9b26]422
[577eb27]423 <para>
424 <parameter>--enable-mbstring</parameter>: This parameter
425 enables multibyte string support.
426 </para>
[934c9b26]427
[577eb27]428 <para>
429 <parameter>--with-readline</parameter>: This parameter
430 enables command line <application>Readline</application> support.
431 </para>
[934c9b26]432
[577eb27]433 <para>
434 <option>--disable-libxml</option>: This option
435 allows building PHP without <application>libxml2</application>
436 installed.
437 </para>
[934c9b26]438
[577eb27]439 <para>
440 <option>--with-apxs2</option>: Instead of building the fastCGI process
441 manager, it is possible to build an <application>apache</application>
442 module. This has some performance penalty for heavy loaded servers,
443 but may be easier to set up. This switch is incompatible with the
444 <parameter>--enable-fpm</parameter> and
445 <parameter>--with-fpm-...</parameter> switches.
446 </para>
[5178bbf6]447
[39ffbd0]448 <para>
[b8efb1fb]449 <option>--with-mysqli=shared</option>: This option includes MySQLi
450 support.
[39ffbd0]451 </para>
452
453 <para>
454 <option>--with-mysql-sock=/run/mysqld/mysqld.sock</option>: Location of
455 the MySQL unix socket pointer.
456 </para>
457
458 <para>
[b8efb1fb]459 <option>--with-pdo-mysql=shared</option>: This option includes PDO:
460 MySQL support.
461 </para>
462
463 <para>
464 <option>--with-tidy=shared</option>: This option includes tidy library
[39ffbd0]465 support.
466 </para>
467
[934c9b26]468 </sect2>
[bccbdaea]469
[db81e4cb]470 <sect2 role="configuration">
471 <title>Configuring PHP</title>
472
473 <sect3 id="php-config">
474 <title>Config Files</title>
475
[577eb27]476 <para>
477 <filename>/etc/php.ini</filename>,
[8f64429]478 <filename>/etc/pear.conf</filename>,
479 <filename>/etc/php-fpm.conf</filename>, and
480 <filename>/etc/php-fpm.d/www.conf</filename>
[577eb27]481 </para>
[db81e4cb]482
483 <indexterm zone="php php-config">
484 <primary sortas="e-etc-php.ini">/etc/php.ini</primary>
485 </indexterm>
486
487 <indexterm zone="php php-config">
488 <primary sortas="e-etc-pear.conf">/etc/pear.conf</primary>
489 </indexterm>
490
[8f64429]491 <indexterm zone="php php-config">
492 <primary sortas="e-etc-php-fpm.d-www.conf">
493 /etc/php-fpm.d/www.conf</primary>
494 </indexterm>
495
[5178bbf6]496 <indexterm zone="php php-config">
497 <primary sortas="e-etc-php-fpm.conf">/etc/php-fpm.conf</primary>
498 </indexterm>
499
[db81e4cb]500 </sect3>
501
502 <sect3>
503 <title>Configuration Information</title>
504
[577eb27]505 <para>
506 The file used as the default <filename>/etc/php.ini</filename>
507 configuration file is recommended by the <application>PHP</application>
508 development team. This file modifies the default behavior of
509 <application>PHP</application>. If no <filename>/etc/php.ini</filename>
510 is used, all configuration settings fall to the defaults. You should
511 review the comments in this file and ensure the changes are acceptable
512 in your particular environment.
513 </para>
[e797436]514
[355b8a9]515 <para>
516 The fastCGI process manager uses the configuration file
517 <filename>/etc/php-fpm.conf</filename>. The default file shipped with
518 PHP includes all the <filename>/etc/php-fpm.d/*.conf</filename> in turn.
519 There is a shipped <filename>/etc/php-fpm.d/www.conf</filename> file,
520 that contains the parameters related to the interaction with the Apache
521 Web server.
522 </para>
523
[577eb27]524 <para>
525 You may have noticed the following from the output of the
526 <command>make install</command> command:
527 </para>
[b84326b7]528
[7c1d541]529<screen><computeroutput>You may want to add: /usr/lib/php to your php.ini include_path</computeroutput></screen>
[b84326b7]530
[577eb27]531 <para>
532 If desired, add the entry using the following command as the
533 <systemitem class="username">root</systemitem> user:
534 </para>
[b84326b7]535
[7c1d541]536<screen role="root"><userinput>sed -i 's@php/includes"@&amp;\ninclude_path = ".:/usr/lib/php"@' \
[b84326b7]537 /etc/php.ini</userinput></screen>
538
[577eb27]539 <para>
540 To enable fastCGI support in the <application>Apache</application>
541 web server, two LoadModule directives must be added to the
542 <filename>httpd.conf</filename> file. They are commented out, so just
543 issue the following command as
544 <systemitem class="username">root</systemitem> user:
545 </para>
[db81e4cb]546
[5178bbf6]547<screen role="root"><userinput>sed -i -e '/proxy_module/s/^#//' \
[7f8868f]548 -e '/proxy_fcgi_module/s/^#//' \
[5178bbf6]549 /etc/httpd/httpd.conf</userinput></screen>
[db81e4cb]550
[577eb27]551 <para>
552 Those modules accept various <command>ProxyPass</command>
553 directives. One possibility is (as the
554 <systemitem class="username">root</systemitem> user):
555 </para>
[5178bbf6]556
557<screen role="root"><userinput>echo \
[7f8868f]558'ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/srv/www/$1' >> \
[5178bbf6]559/etc/httpd/httpd.conf</userinput></screen>
560
[577eb27]561 <para>
562 Additionally, it may be useful to add an entry for
563 <filename>index.php</filename> to the DirectoryIndex directive of the
564 <filename>httpd.conf</filename> file. Lastly, adding a line to setup the
565 <filename class='extension'>.phps</filename> extension to show
566 highlighted <application>PHP</application> source may be
567 desirable:
568 </para>
[e797436]569
570<screen><literal>AddType application/x-httpd-php-source .phps</literal></screen>
[db81e4cb]571
[577eb27]572 <para>
573 You'll need to restart the <application>Apache</application> web server
574 after making any modifications to the <filename>httpd.conf</filename>
575 file.
576 </para>
[db81e4cb]577
578 </sect3>
579
[5178bbf6]580 <sect3 id="php-init">
[0098ace6]581 <title><phrase revision="sysv">Boot Script</phrase>
582 <phrase revision="systemd">Systemd Unit</phrase></title>
[5178bbf6]583
[3c7bd00]584 <para revision="sysv">
[5178bbf6]585 To automatically start the <command>php-fpm</command> daemon when the
586 system is rebooted, install the
587 <filename>/etc/rc.d/init.d/php</filename> bootscript from the
588 <xref linkend="bootscripts"/> package as the
589 <systemitem class="username">root</systemitem> user:
590 </para>
591
[3c7bd00]592 <para revision="systemd">
[0098ace6]593 To start the <command>php-fpm</command> daemon at boot,
594 install the systemd unit from the <xref linkend="systemd-units"/>
595 package by running the following command as the
[3c7bd00]596 <systemitem class="username">root</systemitem> user:
597 </para>
598
599
[5178bbf6]600 <indexterm zone="php php-init">
601 <primary sortas="f-php">php</primary>
602 </indexterm>
603
[3c7bd00]604<screen role="root" revision="sysv"><userinput>make install-php</userinput></screen>
605
606<screen role="root" revision="systemd"><userinput>make install-php-fpm</userinput></screen>
607
[5178bbf6]608 </sect3>
609
[db81e4cb]610 </sect2>
611
612 <sect2 role="content">
613 <title>Contents</title>
614
615 <segmentedlist>
616 <segtitle>Installed Programs</segtitle>
[1c345ed]617 <segtitle>Installed Libraries</segtitle>
[db81e4cb]618 <segtitle>Installed Directories</segtitle>
619
620 <seglistitem>
[8f64429]621 <seg>pear, peardev, pecl, phar (symlink), phar.phar, php,
622 php-cgi, php-config, php-fpm, phpdbg, and phpize</seg>
[17f72f6]623
624 <seg>dba.{so,a} and opcache.{so,a} in
[c93c9bf4]625 /usr/lib/php/extensions/no-debug-non-zts-20180731</seg>
[17f72f6]626
[8f64429]627 <seg>/etc/php-fpm.d, /usr/{include,lib,share}/php and
[ba1a38b]628 /usr/share/doc/php-&php-version;</seg>
[db81e4cb]629 </seglistitem>
630 </segmentedlist>
631
632 <variablelist>
633 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
634 <?dbfo list-presentation="list"?>
635 <?dbhtml list-presentation="table"?>
636
637 <varlistentry id="php-prog">
638 <term><command>php</command></term>
639 <listitem>
[577eb27]640 <para>
641 is a command line interface that enables you to parse and
642 execute PHP code.
643 </para>
[db81e4cb]644 <indexterm zone="php php-prog">
645 <primary sortas="b-php">php</primary>
646 </indexterm>
647 </listitem>
648 </varlistentry>
649
650 <varlistentry id="pear">
651 <term><command>pear</command></term>
652 <listitem>
[577eb27]653 <para>
654 is the PHP Extension and Application Repository (PEAR) package
[c93c9bf4]655 manager. This isn't installed by default.
[577eb27]656 </para>
[db81e4cb]657 <indexterm zone="php pear">
658 <primary sortas="b-pear">pear</primary>
659 </indexterm>
660 </listitem>
661 </varlistentry>
662
[5178bbf6]663 <varlistentry id="php-fpm">
664 <term><command>php-fpm</command></term>
665 <listitem>
[577eb27]666 <para>
667 is the fastCGI process manager for PHP.
668 </para>
[5178bbf6]669 <indexterm zone="php php-fpm">
670 <primary sortas="b-php-fpm">php-fpm</primary>
671 </indexterm>
672 </listitem>
673 </varlistentry>
674
[8f64429]675 <varlistentry id="phpdbg">
676 <term><command>phpdbg</command></term>
677 <listitem>
678 <para>
679 is the interactive PHP debugger.
680 </para>
681 <indexterm zone="php phpdbg">
682 <primary sortas="b-phpdbg">phpdbg</primary>
683 </indexterm>
684 </listitem>
685 </varlistentry>
686
[db81e4cb]687 </variablelist>
688
689 </sect2>
[f45b1953]690
691</sect1>
Note: See TracBrowser for help on using the repository browser.