source: general/prog/php.xml@ 8f3e8197

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.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 8f3e8197 was 8f3e8197, checked in by Bruce Dubbs <bdubbs@…>, 4 years ago

Update to postgresql-12.3.
Update to php-7.4.6.
Update to Python-3.8.3.
Update to highlight-3.57.

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

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