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