1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
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 "https://www.php.net/distributions/php-&php-version;.tar.xz">
|
---|
8 | <!ENTITY php-download-ftp " ">
|
---|
9 | <!ENTITY php-md5sum "eb5a29392a0b2fb18b2d836967abb12e">
|
---|
10 | <!ENTITY php-size "12 MB">
|
---|
11 | <!ENTITY php-buildsize "527 MB (with documentation and tests)">
|
---|
12 | <!ENTITY php-time "1.4 SBU (with parallelism=4; add 1.9 SBU for tests)">
|
---|
13 | <!-- Tests were run for 8.0.1 at -j4, had two timeouts as well.
|
---|
14 | Results were otherwise normal though, so I'm unsure of what caused the
|
---|
15 | increase in time. -renodr
|
---|
16 | No timeout for 8.0.2. Tests run at -j4 too. -pierre
|
---|
17 | No timeouts on 8.0.3 for me this time. -renodr
|
---|
18 | No timeouts on 8.0.5 -bdubbs
|
---|
19 | No timeouts, one failure on 8.0.9 -bdubbs
|
---|
20 | No timeouts on 8.0.10 - thomas
|
---|
21 | No timeouts on 8.0.11 - thomas
|
---|
22 |
|
---|
23 | TEST RESULT SUMMARY 8.1.0
|
---|
24 |
|
---|
25 | Exts skipped : 36
|
---|
26 | Exts tested : 36
|
---|
27 |
|
---|
28 | Number of tests : 17060 12551
|
---|
29 | Tests skipped : 4509 ( 26.4%)
|
---|
30 | Tests warned : 2 ( 0.0%) ( 0.0%)
|
---|
31 | Tests failed : 4 ( 0.0%) ( 0.0%)
|
---|
32 | Expected fail : 28 ( 0.2%) ( 0.2%)
|
---|
33 | Tests passed : 12517 ( 73.4%) ( 99.7%)
|
---|
34 |
|
---|
35 | Time taken : 165 seconds
|
---|
36 |
|
---|
37 | Stats for tests changed slightly for 8.1.1, but not significantly.
|
---|
38 | Stats for tests changed slightly for 8.1.2, but not significantly.
|
---|
39 | Tests failed : 1
|
---|
40 | For 8.1.4, ran tests at -j4. One test still fails.
|
---|
41 | For 8.1.5, ran tests at -j4. One test still fails.
|
---|
42 |
|
---|
43 | Running tests at -j4 does nothing. The jobs count is not passed to the
|
---|
44 | actual routine running the tests.
|
---|
45 |
|
---|
46 | For 8.1.7:
|
---|
47 | Number of tests : 17250 12714
|
---|
48 | Tests skipped : 4536 ( 26.3%)
|
---|
49 | Tests warned : 2 ( 0.0%) ( 0.0%)
|
---|
50 | Tests failed : 1 ( 0.0%) ( 0.0%)
|
---|
51 | Expected fail : 27 ( 0.2%) ( 0.2%)
|
---|
52 | Tests passed : 12684 ( 73.5%) ( 99.8%)
|
---|
53 |
|
---|
54 | Time taken : 162 seconds
|
---|
55 |
|
---|
56 | The warnings are really XFAIL. The FAIL is ext/phar/tests/bug69958.phpt.
|
---|
57 | It appears to be mission a test file.
|
---|
58 |
|
---|
59 | For 8.1.10:
|
---|
60 | Number of tests : 17315 12768
|
---|
61 | Tests skipped : 4547 ( 26.3%) - - - - - - - -
|
---|
62 | Tests warned : 2 ( 0.0%) ( 0.0%)
|
---|
63 | Tests failed : 5 ( 0.0%) ( 0.0%)
|
---|
64 | Expected fail : 27 ( 0.2%) ( 0.2%)
|
---|
65 | Tests passed : 12734 ( 73.5%) ( 99.7%)
|
---|
66 |
|
---|
67 | Time taken : 162 seconds
|
---|
68 |
|
---|
69 | For 8.2.0:
|
---|
70 | Number of tests : 17768 13167
|
---|
71 | Tests skipped : 4601 ( 25.9%) - - - - - - - -
|
---|
72 | Tests warned : 3 ( 0.0%) ( 0.0%)
|
---|
73 | Tests failed : 1 ( 0.0%) ( 0.0%)
|
---|
74 | Expected fail : 25 ( 0.1%) ( 0.2%)
|
---|
75 | Tests passed : 13138 ( 73.9%) ( 99.8%)
|
---|
76 |
|
---|
77 | Time taken : 166 seconds
|
---|
78 |
|
---|
79 | For 8.3.0:
|
---|
80 | Number of tests : 18682 13904
|
---|
81 | Tests skipped : 4778 ( 25.6%) - - - - - - - -
|
---|
82 | Tests warned : 1 ( 0.0%) ( 0.0%)
|
---|
83 | Tests failed : 8 ( 0.0%) ( 0.1%)
|
---|
84 | Expected fail : 9 ( 0.0%) ( 0.1%)
|
---|
85 | Tests passed : 13886 ( 74.3%) ( 99.9%)
|
---|
86 |
|
---|
87 | Time taken : 183 seconds
|
---|
88 |
|
---|
89 | For 8.3.1: [rahul] (Ryzen 7 1700)
|
---|
90 |
|
---|
91 | Number of tests : 18706 13767
|
---|
92 | Tests skipped : 4939 ( 26.4%)
|
---|
93 | Tests warned : 0 ( 0.0%) ( 0.0%)
|
---|
94 | Tests failed : 1 ( 0.0%) ( 0.0%)
|
---|
95 | Expected fail : 9 ( 0.0%) ( 0.1%)
|
---|
96 | Tests passed : 13757 ( 73.5%) ( 99.9%)
|
---|
97 |
|
---|
98 | Time taken : 301 seconds
|
---|
99 |
|
---|
100 | For 8.3.6: [bdubbs] (AMD 3900)
|
---|
101 |
|
---|
102 | Number of tests : 18777 13968
|
---|
103 | Tests skipped : 4809 ( 25.6%)
|
---|
104 | Tests warned : 1 ( 0.0%) ( 0.0%)
|
---|
105 | Tests failed : 2 ( 0.0%) ( 0.0%)
|
---|
106 | Expected fail : 9 ( 0.0%) ( 0.1%)
|
---|
107 | Tests passed : 13956 ( 74.3%) ( 99.9%)
|
---|
108 |
|
---|
109 | Time taken : 189 seconds
|
---|
110 |
|
---|
111 | 8.3.7 gave me (thomas) a few more failed tests but
|
---|
112 | they are caused by redirected stderr/stdout/stdin
|
---|
113 | and not running on a tty. The overall amounts seems
|
---|
114 | comparable to 8.3.6
|
---|
115 |
|
---|
116 |
|
---|
117 | - - - 8.3.8 [renodr] (Xeon E5-2670 v3) - - -
|
---|
118 | Number of tests : 18820 14004
|
---|
119 | Tests skipped : 4816 ( 25.6%) - - - - - - - -
|
---|
120 | Tests warned : 1 ( 0.0%) ( 0.0%)
|
---|
121 | Tests failed : 6 ( 0.0%) ( 0.0%)
|
---|
122 | Expected fail : 10 ( 0.1%) ( 0.1%)
|
---|
123 | Tests passed : 13987 ( 74.3%) ( 99.9%)
|
---|
124 | Time taken : 264 seconds
|
---|
125 |
|
---|
126 | - - - 8.3.10 [renodr] (Xeon E5-2670 v3) - - -
|
---|
127 | Number of tests : 18862 14030
|
---|
128 | Tests skipped : 4832 ( 25.6%) - - - - - - - -
|
---|
129 | Tests warned : 1 ( 0.0%) ( 0.0%)
|
---|
130 | Tests failed : 9 ( 0.0%) ( 0.1%)
|
---|
131 | Expected fail : 10 ( 0.1%) ( 0.1%)
|
---|
132 | Tests passed : 14010 ( 74.3%) ( 99.9%)
|
---|
133 |
|
---|
134 | - - - 8.3.11 [bdubbs] (i7-14700K) performance mode - - -
|
---|
135 | Number of tests : 18890 14045
|
---|
136 | Tests skipped : 4845 ( 25.6%) - - - - - - - -
|
---|
137 | Tests warned : 1 ( 0.0%) ( 0.0%)
|
---|
138 | Tests failed : 4 ( 0.0%) ( 0.0%)
|
---|
139 | Expected fail : 11 ( 0.1%) ( 0.1%)
|
---|
140 | Tests passed : 14029 ( 74.3%) ( 99.9%)
|
---|
141 |
|
---|
142 | Time taken : 163 seconds
|
---|
143 | -->
|
---|
144 | ]>
|
---|
145 |
|
---|
146 | <sect1 id="php" xreflabel="PHP-&php-version;">
|
---|
147 | <?dbhtml filename="php.html"?>
|
---|
148 |
|
---|
149 |
|
---|
150 | <title>PHP-&php-version;</title>
|
---|
151 |
|
---|
152 | <indexterm zone="php">
|
---|
153 | <primary sortas="a-PHP">PHP</primary>
|
---|
154 | </indexterm>
|
---|
155 |
|
---|
156 | <sect2 role="package">
|
---|
157 | <title>Introduction to PHP</title>
|
---|
158 |
|
---|
159 | <para>
|
---|
160 | <application>PHP</application> is the PHP Hypertext Preprocessor.
|
---|
161 | Primarily used in dynamic web sites, it allows for programming code to be
|
---|
162 | directly embedded into the HTML markup. It is also useful as a
|
---|
163 | general purpose scripting language.
|
---|
164 | </para>
|
---|
165 |
|
---|
166 | &lfs122_checked;
|
---|
167 |
|
---|
168 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
169 | <itemizedlist spacing="compact">
|
---|
170 | <listitem>
|
---|
171 | <para>
|
---|
172 | Download (HTTP): <ulink url="&php-download-http;"/>
|
---|
173 | </para>
|
---|
174 | </listitem>
|
---|
175 | <listitem>
|
---|
176 | <para>
|
---|
177 | Download (FTP): <ulink url="&php-download-ftp;"/>
|
---|
178 | </para>
|
---|
179 | </listitem>
|
---|
180 | <listitem>
|
---|
181 | <para>
|
---|
182 | Download MD5 sum: &php-md5sum;
|
---|
183 | </para>
|
---|
184 | </listitem>
|
---|
185 | <listitem>
|
---|
186 | <para>
|
---|
187 | Download size: &php-size;
|
---|
188 | </para>
|
---|
189 | </listitem>
|
---|
190 | <listitem>
|
---|
191 | <para>
|
---|
192 | Estimated disk space required: &php-buildsize;
|
---|
193 | </para>
|
---|
194 | </listitem>
|
---|
195 | <listitem>
|
---|
196 | <para>
|
---|
197 | Estimated build time: &php-time;
|
---|
198 | </para>
|
---|
199 | </listitem>
|
---|
200 | </itemizedlist>
|
---|
201 |
|
---|
202 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
203 | <itemizedlist spacing="compact">
|
---|
204 | <listitem>
|
---|
205 | <para>
|
---|
206 | Optional pre-built documentation (single file html): <ulink
|
---|
207 | url="https://www.php.net/distributions/manual/php_manual_en.html.gz"/>
|
---|
208 | </para>
|
---|
209 | </listitem>
|
---|
210 | <listitem>
|
---|
211 | <para>
|
---|
212 | Optional pre-built documentation (chunked html): <ulink
|
---|
213 | url="https://www.php.net/distributions/manual/php_manual_en.tar.gz"/>.
|
---|
214 | Note that the documentation can be found in languages other than
|
---|
215 | English at <ulink url="https://www.php.net/download-docs.php"/>
|
---|
216 | </para>
|
---|
217 | </listitem>
|
---|
218 | </itemizedlist>
|
---|
219 |
|
---|
220 | <bridgehead renderas="sect3">PHP Dependencies</bridgehead>
|
---|
221 |
|
---|
222 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
223 | <para role="recommended">
|
---|
224 | <xref linkend="apache"/> and
|
---|
225 | <xref linkend="libxml2"/>
|
---|
226 | </para>
|
---|
227 |
|
---|
228 | <bridgehead renderas="sect4">Optional System Utilities and Libraries</bridgehead>
|
---|
229 | <para role="optional">
|
---|
230 | <xref linkend="aspell"/>,
|
---|
231 | <xref linkend="enchant"/>,
|
---|
232 | <xref linkend="libxslt"/>,
|
---|
233 | an <xref linkend="server-mail"/> (that provides a
|
---|
234 | <command>sendmail</command> command),
|
---|
235 | <xref linkend="pcre2"/>,
|
---|
236 | <ulink url="https://wiki.ubuntu.com/AppArmor">AppArmor</ulink>,
|
---|
237 | <ulink url="https://dmalloc.com/">Dmalloc</ulink>,
|
---|
238 | <ulink url="http://www.net-snmp.org/">Net-SNMP</ulink>,
|
---|
239 | <ulink url="https://github.com/kkos/oniguruma">oniguruma</ulink>,
|
---|
240 | <ulink url="http://www.ossp.org/pkg/lib/mm/">OSSP mm</ulink>,
|
---|
241 | <ulink url="https://re2c.org/">re2c</ulink>, and
|
---|
242 | <ulink url="https://xmlrpc-epi.sourceforge.net/main.php?t=php_about">XMLRPC-EPI</ulink>
|
---|
243 | </para>
|
---|
244 |
|
---|
245 | <bridgehead renderas="sect4">Optional Graphics Utilities and Libraries</bridgehead>
|
---|
246 | <para role="optional">
|
---|
247 | <xref linkend="freetype2"/>,
|
---|
248 | <xref linkend="libexif"/>,
|
---|
249 | <xref linkend="libjpeg"/>,
|
---|
250 | <xref linkend="libpng"/>,
|
---|
251 | <xref linkend="libtiff"/>,
|
---|
252 | <xref linkend="libwebp"/>,
|
---|
253 | <xref linkend="x-window-system"/>,
|
---|
254 | <!--<ulink url="http://www.fastio.com/">ClibPDF</ulink>, - site asks for username/password-->
|
---|
255 | <ulink url="https://opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/">FDF Toolkit</ulink>,
|
---|
256 | <ulink url="https://github.com/libgd/libgd">GD</ulink>, and
|
---|
257 | <ulink url="https://www.t1lib.org/">t1lib</ulink>
|
---|
258 | </para>
|
---|
259 |
|
---|
260 | <bridgehead renderas="sect4">Optional Web Utilities</bridgehead>
|
---|
261 | <para role="optional">
|
---|
262 | <xref linkend="curl"/>,
|
---|
263 | <xref linkend="tidy-html5"/>,
|
---|
264 | <ulink url="https://sourceforge.net/projects/caudium/">Caudium</ulink>,
|
---|
265 | <ulink url="https://www.hyperwave.com/en/">Hyperwave</ulink>,
|
---|
266 | <ulink url="https://download.roxen.com/6.1/">Roxen WebServer</ulink>, and
|
---|
267 | <ulink url="https://github.com/Bilal-S/WDDX.net">WDDX</ulink>
|
---|
268 | </para>
|
---|
269 |
|
---|
270 | <bridgehead renderas="sect4">Optional Data Management Utilities and Libraries</bridgehead>
|
---|
271 | <para role="optional">
|
---|
272 | <xref linkend="lmdb"/>,
|
---|
273 | <xref linkend="mariadb"/> or <ulink url="https://www.mysql.com/">MySQL</ulink>,
|
---|
274 | <xref linkend="openldap"/>,
|
---|
275 | <xref linkend="postgresql"/>,
|
---|
276 | <xref linkend="sqlite"/>,
|
---|
277 | <xref linkend="unixodbc"/>,
|
---|
278 | &berkeley-db;
|
---|
279 | <ulink url="https://www.softwareag.com/en_corporate/platform/adabas-natural.html">Adabas</ulink>,
|
---|
280 | <ulink url="https://raima.com/product-overview/">Birdstep</ulink>,
|
---|
281 | <ulink url="https://cr.yp.to/cdb.html">cdb</ulink>,
|
---|
282 | <ulink url="https://www.dbmaker.com/">DBMaker</ulink>,
|
---|
283 | <ulink url="http://www.empress.com/">Empress</ulink>,
|
---|
284 | <ulink url="http://www.frontbase.com/cgi-bin/WebObjects/FBWebSite">FrontBase</ulink>,
|
---|
285 | <ulink url="https://www.ibm.com/analytics/us/en/db2/">IBM DB2</ulink>,
|
---|
286 | <ulink url="https://sourceforge.net/projects/iodbc/files/">libiodbc</ulink>,
|
---|
287 | <ulink url="https://hughestech.com.au/products/msql/">Mini SQL</ulink>,
|
---|
288 | <ulink url="https://www.monetra.com/">Monetra</ulink>, and
|
---|
289 | <ulink url="https://sourceforge.net/projects/qdbm">QDBM</ulink>
|
---|
290 | </para>
|
---|
291 |
|
---|
292 | <para>
|
---|
293 | <application>PHP</application> also provides support for many
|
---|
294 | commercial database tools such as <application>Oracle</application>,
|
---|
295 | <application>SAP</application> and
|
---|
296 | <application>ODBC Router</application>.
|
---|
297 | </para>
|
---|
298 |
|
---|
299 | <bridgehead renderas="sect4">Optional Security/Encryption Utilities and Libraries</bridgehead>
|
---|
300 | <para role="optional">
|
---|
301 | <xref linkend="cyrus-sasl"/>,
|
---|
302 | <xref linkend="mitkrb"/>,
|
---|
303 | <ulink url="https://mcrypt.sourceforge.net/">libmcrypt</ulink>, and
|
---|
304 | <ulink url="https://mhash.sourceforge.net/">mhash</ulink>
|
---|
305 | </para>
|
---|
306 |
|
---|
307 | <para condition="html" role="usernotes">
|
---|
308 | Editor Notes: <ulink url="&blfs-wiki;/php"/>
|
---|
309 | </para>
|
---|
310 |
|
---|
311 | </sect2>
|
---|
312 |
|
---|
313 | <sect2 role="installation">
|
---|
314 | <title>Installation of PHP</title>
|
---|
315 |
|
---|
316 | <para>
|
---|
317 | You can use <application>PHP</application> for server-side
|
---|
318 | scripting, command-line scripting or client-side GUI applications. This
|
---|
319 | book provides instructions for setting up <application>PHP</application>
|
---|
320 | for server-side scripting as it is the most common form.
|
---|
321 | </para>
|
---|
322 |
|
---|
323 | <note>
|
---|
324 | <para>
|
---|
325 | <application>PHP</application> has many more
|
---|
326 | <command>configure</command> options that will enable support for
|
---|
327 | various things. You can use <command>./configure --help</command> to
|
---|
328 | see a full list of the available options. Also, use of the
|
---|
329 | <ulink url="https://www.php.net/">PHP web site</ulink>
|
---|
330 | is highly recommended, as their online docs are very good. An example
|
---|
331 | of a <command>configure</command> command that utilizes many of the
|
---|
332 | most common dependencies can be found at <ulink
|
---|
333 | url="&sources-anduin-http;/files/php_configure.txt"/>.
|
---|
334 | </para>
|
---|
335 |
|
---|
336 | <para>
|
---|
337 | If, for whatever reason, you don't have <xref linkend="libxml2"/>
|
---|
338 | installed, you need to add <option>--disable-libxml</option> to the
|
---|
339 | <command>configure</command> command in the instructions below. Note
|
---|
340 | that this will prevent the <command>pear</command> command from being
|
---|
341 | built.
|
---|
342 | </para>
|
---|
343 | </note>
|
---|
344 |
|
---|
345 | <para>
|
---|
346 | Install <application>PHP</application> by running the following commands:
|
---|
347 | </para>
|
---|
348 |
|
---|
349 | <screen revision="sysv"><userinput>./configure --prefix=/usr \
|
---|
350 | --sysconfdir=/etc \
|
---|
351 | --localstatedir=/var \
|
---|
352 | --datadir=/usr/share/php \
|
---|
353 | --mandir=/usr/share/man \
|
---|
354 | --without-pear \
|
---|
355 | --enable-fpm \
|
---|
356 | --with-fpm-user=apache \
|
---|
357 | --with-fpm-group=apache \
|
---|
358 | --with-config-file-path=/etc \
|
---|
359 | --with-zlib \
|
---|
360 | --enable-bcmath \
|
---|
361 | --with-bz2 \
|
---|
362 | --enable-calendar \
|
---|
363 | --enable-dba=shared \
|
---|
364 | --with-gdbm \
|
---|
365 | --with-gmp \
|
---|
366 | --enable-ftp \
|
---|
367 | --with-gettext \
|
---|
368 | --enable-mbstring \
|
---|
369 | --disable-mbregex \
|
---|
370 | --with-readline &&
|
---|
371 | make</userinput></screen>
|
---|
372 |
|
---|
373 | <screen revision="systemd"><userinput>./configure --prefix=/usr \
|
---|
374 | --sysconfdir=/etc \
|
---|
375 | --localstatedir=/var \
|
---|
376 | --datadir=/usr/share/php \
|
---|
377 | --mandir=/usr/share/man \
|
---|
378 | --enable-fpm \
|
---|
379 | --without-pear \
|
---|
380 | --with-fpm-user=apache \
|
---|
381 | --with-fpm-group=apache \
|
---|
382 | --with-fpm-systemd \
|
---|
383 | --with-config-file-path=/etc \
|
---|
384 | --with-zlib \
|
---|
385 | --enable-bcmath \
|
---|
386 | --with-bz2 \
|
---|
387 | --enable-calendar \
|
---|
388 | --enable-dba=shared \
|
---|
389 | --with-gdbm \
|
---|
390 | --with-gmp \
|
---|
391 | --enable-ftp \
|
---|
392 | --with-gettext \
|
---|
393 | --enable-mbstring \
|
---|
394 | --disable-mbregex \
|
---|
395 | --with-readline &&
|
---|
396 | make</userinput></screen>
|
---|
397 | <para>
|
---|
398 | To test the results, issue: <command>make test</command>. Several
|
---|
399 | tests (out of over 18000) may fail, in which case you are asked
|
---|
400 | whether you want to send the report to the PHP developers. If you
|
---|
401 | want to automate the test, you may prefix the command with
|
---|
402 | <command>yes "n" | </command>.
|
---|
403 | </para>
|
---|
404 |
|
---|
405 | <para>
|
---|
406 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
407 | </para>
|
---|
408 |
|
---|
409 | <!-- dev note: make INSTALL_ROOT=<DESTDIR> install -->
|
---|
410 |
|
---|
411 | <screen role="root"><userinput>make install &&
|
---|
412 | install -v -m644 php.ini-production /etc/php.ini &&
|
---|
413 |
|
---|
414 | install -v -m755 -d /usr/share/doc/php-&php-version; &&
|
---|
415 | install -v -m644 CODING_STANDARDS* EXTENSIONS NEWS README* UPGRADING* \
|
---|
416 | /usr/share/doc/php-&php-version;</userinput></screen>
|
---|
417 |
|
---|
418 | <para>
|
---|
419 | The default configuration files for the fastCGI process manager are
|
---|
420 | installed only if they do not already exist on the system. If this is
|
---|
421 | the first installation, they should be renamed, as the
|
---|
422 | <systemitem class='username'>root</systemitem> user:
|
---|
423 | </para>
|
---|
424 |
|
---|
425 | <screen role="root"><userinput>if [ -f /etc/php-fpm.conf.default ]; then
|
---|
426 | mv -v /etc/php-fpm.conf{.default,} &&
|
---|
427 | mv -v /etc/php-fpm.d/www.conf{.default,}
|
---|
428 | fi</userinput></screen>
|
---|
429 |
|
---|
430 | <para>
|
---|
431 | The pre-built HTML documentation is packaged in two forms: a tarball
|
---|
432 | containing many individual files, useful for quick loading into your
|
---|
433 | browser, and one large individual file, which is useful for using the
|
---|
434 | search utility of your browser. If you downloaded either, or both, of the
|
---|
435 | documentation files, issue the following commands as the
|
---|
436 | <systemitem class='username'>root</systemitem> user to install them (note
|
---|
437 | these instructions assume English docs, modify the tarball names below if
|
---|
438 | necessary).
|
---|
439 | </para>
|
---|
440 |
|
---|
441 | <para>
|
---|
442 | For the <quote>Single HTML</quote> file:
|
---|
443 | </para>
|
---|
444 |
|
---|
445 | <screen role="root"><userinput>install -v -m644 ../php_manual_en.html.gz \
|
---|
446 | /usr/share/doc/php-&php-version; &&
|
---|
447 | gunzip -v /usr/share/doc/php-&php-version;/php_manual_en.html.gz</userinput></screen>
|
---|
448 |
|
---|
449 | <para>
|
---|
450 | For the <quote>Many HTML files</quote> tarball:
|
---|
451 | </para>
|
---|
452 |
|
---|
453 | <screen role="root"><userinput>tar -xvf ../php_manual_en.tar.gz \
|
---|
454 | -C /usr/share/doc/php-&php-version; --no-same-owner</userinput></screen>
|
---|
455 |
|
---|
456 | <para>
|
---|
457 | The bundled pear is not installed because of a bug which might
|
---|
458 | pollute the filesystem with several hidden files and directories.
|
---|
459 | If pear is needed, execute the following commands to install it:
|
---|
460 | </para>
|
---|
461 |
|
---|
462 | <screen role="nodump"><userinput>wget https://pear.php.net/go-pear.phar
|
---|
463 | php ./go-pear.phar</userinput></screen>
|
---|
464 |
|
---|
465 | </sect2>
|
---|
466 |
|
---|
467 | <sect2 role="commands">
|
---|
468 | <title>Command Explanations</title>
|
---|
469 |
|
---|
470 | <para>
|
---|
471 | <parameter>--datadir=/usr/share/php</parameter>: This works
|
---|
472 | around a bug in the build machinery, which installs some data to a
|
---|
473 | wrong location.
|
---|
474 | </para>
|
---|
475 |
|
---|
476 | <para>
|
---|
477 | <parameter>--enable-fpm</parameter>: This parameter allows
|
---|
478 | building the fastCGI Process Manager.
|
---|
479 | </para>
|
---|
480 |
|
---|
481 | <para revision="systemd">
|
---|
482 | <parameter>--with-fpm-systemd</parameter>: This parameter allows
|
---|
483 | the FastCGI Process Manager to integrate with systemd.
|
---|
484 | </para>
|
---|
485 |
|
---|
486 | <para>
|
---|
487 | <parameter>--without-pear</parameter>: This switch disables
|
---|
488 | installation of bundled pear software.
|
---|
489 | </para>
|
---|
490 |
|
---|
491 | <para>
|
---|
492 | <parameter>--with-config-file-path=/etc</parameter>: This parameter
|
---|
493 | makes <application>PHP</application> look for the
|
---|
494 | <filename>php.ini</filename> configuration file in
|
---|
495 | <filename class='directory'>/etc</filename>.
|
---|
496 | </para>
|
---|
497 |
|
---|
498 | <para>
|
---|
499 | <parameter>--with-zlib</parameter>: This parameter adds
|
---|
500 | support for <application>Zlib</application> compression.
|
---|
501 | </para>
|
---|
502 |
|
---|
503 | <para>
|
---|
504 | <parameter>--enable-bcmath</parameter>: Enables
|
---|
505 | <command>bc</command> style precision math functions.
|
---|
506 | </para>
|
---|
507 |
|
---|
508 | <para>
|
---|
509 | <parameter>--with-bz2</parameter>: Adds support for
|
---|
510 | <application>Bzip2</application> compression functions.
|
---|
511 | </para>
|
---|
512 |
|
---|
513 | <para>
|
---|
514 | <parameter>--enable-calendar</parameter>: This parameter
|
---|
515 | provides support for calendar conversion.
|
---|
516 | </para>
|
---|
517 |
|
---|
518 | <para>
|
---|
519 | <parameter>--enable-dba=shared</parameter>: This parameter enables
|
---|
520 | support for database (dbm-style) abstraction layer functions.
|
---|
521 | </para>
|
---|
522 |
|
---|
523 | <para>
|
---|
524 | <parameter>--enable-ftp</parameter>: This parameter
|
---|
525 | enables FTP functions.
|
---|
526 | </para>
|
---|
527 |
|
---|
528 | <para>
|
---|
529 | <parameter>--with-gettext</parameter>: Enables functions
|
---|
530 | that use <application>Gettext</application> text translation.
|
---|
531 | </para>
|
---|
532 |
|
---|
533 | <para>
|
---|
534 | <parameter>--enable-mbstring</parameter>: This parameter
|
---|
535 | enables multibyte string support.
|
---|
536 | </para>
|
---|
537 |
|
---|
538 | <!--
|
---|
539 | <para>
|
---|
540 | <parameter>- -disable-mbstring</parameter>: This parameter
|
---|
541 | disables multibyte string regular expression support. It
|
---|
542 | requires the external
|
---|
543 | <ulink url="https://github.com/kkos/oniguruma">oniguruma</ulink>
|
---|
544 | library.
|
---|
545 | </para>
|
---|
546 | -->
|
---|
547 | <para>
|
---|
548 | <parameter>--with-readline</parameter>: This parameter
|
---|
549 | enables command line <application>Readline</application> support.
|
---|
550 | </para>
|
---|
551 |
|
---|
552 | <para>
|
---|
553 | <option>--disable-libxml</option>: This option
|
---|
554 | allows building PHP without <application>libxml2</application>
|
---|
555 | installed.
|
---|
556 | </para>
|
---|
557 |
|
---|
558 | <para>
|
---|
559 | <option>--with-apxs2</option>: Instead of building the fastCGI process
|
---|
560 | manager, it is possible to build an <application>apache</application>
|
---|
561 | module. This has some performance penalty for heavy loaded servers,
|
---|
562 | but may be easier to set up. This switch is incompatible with the
|
---|
563 | <parameter>--enable-fpm</parameter> and
|
---|
564 | <parameter>--with-fpm-...</parameter> switches.
|
---|
565 | </para>
|
---|
566 |
|
---|
567 | <para>
|
---|
568 | <option>--with-mysqli=shared</option>: This option includes MySQLi
|
---|
569 | support.
|
---|
570 | </para>
|
---|
571 |
|
---|
572 | <para>
|
---|
573 | <option>--with-mysql-sock=/run/mysqld/mysqld.sock</option>: Location of
|
---|
574 | the MySQL unix socket pointer.
|
---|
575 | </para>
|
---|
576 |
|
---|
577 | <para>
|
---|
578 | <option>--with-pdo-mysql=shared</option>: This option includes PDO:
|
---|
579 | MySQL support.
|
---|
580 | </para>
|
---|
581 |
|
---|
582 | <para>
|
---|
583 | <option>--with-tidy=shared</option>: This option includes tidy library
|
---|
584 | support.
|
---|
585 | </para>
|
---|
586 |
|
---|
587 | </sect2>
|
---|
588 |
|
---|
589 | <sect2 role="configuration">
|
---|
590 | <title>Configuring PHP</title>
|
---|
591 |
|
---|
592 | <sect3 id="php-config">
|
---|
593 | <title>Config Files</title>
|
---|
594 |
|
---|
595 | <para>
|
---|
596 | <filename>/etc/php.ini</filename>,
|
---|
597 | <filename>/etc/pear.conf</filename>,
|
---|
598 | <filename>/etc/php-fpm.conf</filename>, and
|
---|
599 | <filename>/etc/php-fpm.d/www.conf</filename>
|
---|
600 | </para>
|
---|
601 |
|
---|
602 | <indexterm zone="php php-config">
|
---|
603 | <primary sortas="e-etc-php.ini">/etc/php.ini</primary>
|
---|
604 | </indexterm>
|
---|
605 |
|
---|
606 | <indexterm zone="php php-config">
|
---|
607 | <primary sortas="e-etc-pear.conf">/etc/pear.conf</primary>
|
---|
608 | </indexterm>
|
---|
609 |
|
---|
610 | <indexterm zone="php php-config">
|
---|
611 | <primary sortas="e-etc-php-fpm.d-www.conf">
|
---|
612 | /etc/php-fpm.d/www.conf</primary>
|
---|
613 | </indexterm>
|
---|
614 |
|
---|
615 | <indexterm zone="php php-config">
|
---|
616 | <primary sortas="e-etc-php-fpm.conf">/etc/php-fpm.conf</primary>
|
---|
617 | </indexterm>
|
---|
618 |
|
---|
619 | </sect3>
|
---|
620 |
|
---|
621 | <sect3>
|
---|
622 | <title>Configuration Information</title>
|
---|
623 |
|
---|
624 | <para>
|
---|
625 | The file used as the default <filename>/etc/php.ini</filename>
|
---|
626 | configuration file is recommended by the <application>PHP</application>
|
---|
627 | development team. This file modifies the default behavior of
|
---|
628 | <application>PHP</application>. If no <filename>/etc/php.ini</filename>
|
---|
629 | is used, all configuration settings fall to the defaults. You should
|
---|
630 | review the comments in this file and ensure the changes are acceptable
|
---|
631 | in your particular environment.
|
---|
632 | </para>
|
---|
633 |
|
---|
634 | <para>
|
---|
635 | The fastCGI process manager uses the configuration file
|
---|
636 | <filename>/etc/php-fpm.conf</filename>. The default file shipped with
|
---|
637 | PHP includes all the <filename>/etc/php-fpm.d/*.conf</filename> in turn.
|
---|
638 | There is a shipped <filename>/etc/php-fpm.d/www.conf</filename> file,
|
---|
639 | that contains the parameters related to the interaction with the Apache
|
---|
640 | Web server.
|
---|
641 | </para>
|
---|
642 |
|
---|
643 | <para>
|
---|
644 | You may have noticed the following from the output of the
|
---|
645 | <command>make install</command> command:
|
---|
646 | </para>
|
---|
647 |
|
---|
648 | <screen><computeroutput>You may want to add: /usr/lib/php to your php.ini include_path</computeroutput></screen>
|
---|
649 |
|
---|
650 | <para>
|
---|
651 | If desired, add the entry using the following command as the
|
---|
652 | <systemitem class="username">root</systemitem> user:
|
---|
653 | </para>
|
---|
654 |
|
---|
655 | <screen role="root"><userinput>sed -i 's@php/includes"@&\ninclude_path = ".:/usr/lib/php"@' \
|
---|
656 | /etc/php.ini</userinput></screen>
|
---|
657 |
|
---|
658 | <para>
|
---|
659 | To enable fastCGI support in the <application>Apache</application>
|
---|
660 | web server, two LoadModule directives must be added to the
|
---|
661 | <filename>httpd.conf</filename> file. They are commented out, so just
|
---|
662 | issue the following command as
|
---|
663 | <systemitem class="username">root</systemitem> user:
|
---|
664 | </para>
|
---|
665 |
|
---|
666 | <screen role="root"><userinput>sed -i -e '/proxy_module/s/^#//' \
|
---|
667 | -e '/proxy_fcgi_module/s/^#//' \
|
---|
668 | /etc/httpd/httpd.conf</userinput></screen>
|
---|
669 |
|
---|
670 | <para>
|
---|
671 | Those modules accept various <command>ProxyPass</command>
|
---|
672 | directives. One possibility is (as the
|
---|
673 | <systemitem class="username">root</systemitem> user):
|
---|
674 | </para>
|
---|
675 |
|
---|
676 | <screen role="root"><userinput>echo \
|
---|
677 | 'ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/srv/www/$1' >> \
|
---|
678 | /etc/httpd/httpd.conf</userinput></screen>
|
---|
679 |
|
---|
680 | <para>
|
---|
681 | Additionally, it may be useful to add an entry for
|
---|
682 | <filename>index.php</filename> to the DirectoryIndex directive of the
|
---|
683 | <filename>httpd.conf</filename> file. Lastly, adding a line to set up the
|
---|
684 | <filename class='extension'>.phps</filename> extension to show
|
---|
685 | highlighted <application>PHP</application> source may be
|
---|
686 | desirable:
|
---|
687 | </para>
|
---|
688 |
|
---|
689 | <screen><literal>AddType application/x-httpd-php-source .phps</literal></screen>
|
---|
690 |
|
---|
691 | <para>
|
---|
692 | You'll need to restart the <application>Apache</application> web server
|
---|
693 | after making any modifications to the <filename>httpd.conf</filename>
|
---|
694 | file.
|
---|
695 | </para>
|
---|
696 |
|
---|
697 | </sect3>
|
---|
698 |
|
---|
699 | <sect3 id="php-init">
|
---|
700 | <title><phrase revision="sysv">Boot Script</phrase>
|
---|
701 | <phrase revision="systemd">Systemd Unit</phrase></title>
|
---|
702 |
|
---|
703 | <para revision="sysv">
|
---|
704 | To automatically start the <command>php-fpm</command> daemon when the
|
---|
705 | system is rebooted, install the
|
---|
706 | <filename>/etc/rc.d/init.d/php</filename> bootscript from the
|
---|
707 | <xref linkend="bootscripts"/> package as the
|
---|
708 | <systemitem class="username">root</systemitem> user:
|
---|
709 | </para>
|
---|
710 |
|
---|
711 | <para revision="systemd">
|
---|
712 | To start the <command>php-fpm</command> daemon at boot,
|
---|
713 | install the systemd unit from the <xref linkend="systemd-units"/>
|
---|
714 | package by running the following command as the
|
---|
715 | <systemitem class="username">root</systemitem> user:
|
---|
716 | </para>
|
---|
717 |
|
---|
718 |
|
---|
719 | <indexterm zone="php php-init">
|
---|
720 | <primary sortas="f-php">php</primary>
|
---|
721 | </indexterm>
|
---|
722 |
|
---|
723 | <screen role="root" revision="sysv"><userinput>make install-php</userinput></screen>
|
---|
724 |
|
---|
725 | <screen role="root" revision="systemd"><userinput>make install-php-fpm</userinput></screen>
|
---|
726 |
|
---|
727 | </sect3>
|
---|
728 |
|
---|
729 | </sect2>
|
---|
730 |
|
---|
731 | <sect2 role="content">
|
---|
732 | <title>Contents</title>
|
---|
733 |
|
---|
734 | <segmentedlist>
|
---|
735 | <segtitle>Installed Programs</segtitle>
|
---|
736 | <segtitle>Installed Libraries</segtitle>
|
---|
737 | <segtitle>Installed Directories</segtitle>
|
---|
738 |
|
---|
739 | <seglistitem>
|
---|
740 | <seg><!-- not built anymore pear, peardev, pecl,-->
|
---|
741 | phar (symlink), phar.phar, php,
|
---|
742 | php-cgi, php-config, php-fpm, phpdbg, and phpize</seg>
|
---|
743 |
|
---|
744 | <seg>dba.so and opcache.so in
|
---|
745 | /usr/lib/php/extensions/no-debug-non-zts-20230831</seg>
|
---|
746 |
|
---|
747 | <seg>/etc/php-fpm.d, /usr/{include,lib,share}/php, and
|
---|
748 | /usr/share/doc/php-&php-version;</seg>
|
---|
749 | </seglistitem>
|
---|
750 | </segmentedlist>
|
---|
751 |
|
---|
752 | <variablelist>
|
---|
753 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
754 | <?dbfo list-presentation="list"?>
|
---|
755 | <?dbhtml list-presentation="table"?>
|
---|
756 |
|
---|
757 | <varlistentry id="php-prog">
|
---|
758 | <term><command>php</command></term>
|
---|
759 | <listitem>
|
---|
760 | <para>
|
---|
761 | is a command line interface that enables you to parse and
|
---|
762 | execute PHP code
|
---|
763 | </para>
|
---|
764 | <indexterm zone="php php-prog">
|
---|
765 | <primary sortas="b-php">php</primary>
|
---|
766 | </indexterm>
|
---|
767 | </listitem>
|
---|
768 | </varlistentry>
|
---|
769 |
|
---|
770 | <varlistentry id="pear">
|
---|
771 | <term><command>pear</command></term>
|
---|
772 | <listitem>
|
---|
773 | <para>
|
---|
774 | is the PHP Extension and Application Repository (PEAR) package
|
---|
775 | manager. This isn't installed by default
|
---|
776 | </para>
|
---|
777 | <indexterm zone="php pear">
|
---|
778 | <primary sortas="b-pear">pear</primary>
|
---|
779 | </indexterm>
|
---|
780 | </listitem>
|
---|
781 | </varlistentry>
|
---|
782 |
|
---|
783 | <varlistentry id="php-fpm">
|
---|
784 | <term><command>php-fpm</command></term>
|
---|
785 | <listitem>
|
---|
786 | <para>
|
---|
787 | is the fastCGI process manager for PHP
|
---|
788 | </para>
|
---|
789 | <indexterm zone="php php-fpm">
|
---|
790 | <primary sortas="b-php-fpm">php-fpm</primary>
|
---|
791 | </indexterm>
|
---|
792 | </listitem>
|
---|
793 | </varlistentry>
|
---|
794 |
|
---|
795 | <varlistentry id="phpdbg">
|
---|
796 | <term><command>phpdbg</command></term>
|
---|
797 | <listitem>
|
---|
798 | <para>
|
---|
799 | is the interactive PHP debugger
|
---|
800 | </para>
|
---|
801 | <indexterm zone="php phpdbg">
|
---|
802 | <primary sortas="b-phpdbg">phpdbg</primary>
|
---|
803 | </indexterm>
|
---|
804 | </listitem>
|
---|
805 | </varlistentry>
|
---|
806 |
|
---|
807 | </variablelist>
|
---|
808 |
|
---|
809 | </sect2>
|
---|
810 |
|
---|
811 | </sect1>
|
---|