source: general/prog/php-systemd.xml@ cf193634

systemd-13485
Last change on this file since cf193634 was cf193634, checked in by Douglas R. Reno <renodr@…>, 8 years ago

Update to libxcb-1.11.1
Update to dhcpcd-6.9.3
Update to wpa_supplicant-2.5
Update to SQLite-3.9.2
Tags

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/branches/systemd@16650 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 19.5 KB
Line 
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 "ftp://ftp.isu.edu.tw/pub/Unix/Web/PHP/distributions/php-&php-version;.tar.xz">
9 <!ENTITY php-md5sum "f2cc602602eb2b121779f2c4b8bacaba">
10 <!ENTITY php-size "12 MB">
11 <!ENTITY php-buildsize "394 MB (with tests)">
12 <!ENTITY php-time "5.6 SBU (with 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 &lfs78_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 <xref linkend="pcre"/>,
99 <xref linkend="pth"/>,
100 an <xref linkend="server-mail"/> (that provides a
101 <command>sendmail</command> command)
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>,
106 <ulink url="http://xmlrpc-epi.sourceforge.net/main.php?t=php_about">XMLRPC-EPI</ulink>, and
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>,
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/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="html-tidy"/>,
127 <ulink url="http://sourceforge.net/projects/caudium/">Caudium</ulink>,
128 <ulink url="http://www.hyperwave.com/">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"/>,
137 <xref linkend="mariadb"/> or <ulink url="http://www.mysql.com/">MySQL</ulink>,
138 <xref linkend="openldap"/>,
139 <xref linkend="postgresql"/>,
140 <xref linkend="sqlite"/>,
141 <xref linkend="unixodbc"/>,
142 <ulink url="http://www.softwareag.com/">Abadas</ulink>,
143 <ulink url="http://www.birdstep.com/">Birdstep</ulink>,
144 <ulink url="http://cr.yp.to/cdb.html">cdb</ulink>,
145 <ulink url="http://www.dbmaker.com/">DBMaker</ulink>,
146 <ulink url="http://www.empress.com/">Empress</ulink>,
147 <ulink url="http://www.frontbase.com/">FrontBase</ulink>,
148 <ulink url="http://www.hughes.com.au/products/msql/">Mini SQL</ulink>,
149 <ulink url="http://www.monetra.com/">Monetra</ulink>, and
150 <ulink url="http://sourceforge.net/projects/qdbm">QDBM</ulink>
151 </para>
152
153 <para>
154 <application>PHP</application> also provides support for many
155 commercial database tools such as <application>Oracle</application>,
156 <application>SAP</application> and
157 <application>ODBC Router</application>.
158 </para>
159
160 <bridgehead renderas="sect4">Optional Security/Encryption Utilities and Libraries</bridgehead>
161 <para role="optional">
162 <xref linkend="cyrus-sasl"/>,
163 <xref linkend="mitkrb"/>,
164 <xref linkend="openssl"/>,
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 Install <application>PHP</application> by running the following commands:
209 </para>
210
211<screen><userinput>sed -i "s|lsystemd-daemon|lsystemd|g" configure &amp;&amp;
212
213./configure --prefix=/usr \
214 --sysconfdir=/etc \
215 --localstatedir=/var \
216 --datadir=/usr/share/php \
217 --mandir=/usr/share/man \
218 --enable-fpm \
219 --with-fpm-user=apache \
220 --with-fpm-group=apache \
221 --with-fpm-systemd \
222 --with-config-file-path=/etc \
223 --with-zlib \
224 --enable-bcmath \
225 --with-bz2 \
226 --enable-calendar \
227 --enable-dba=shared \
228 --with-gdbm \
229 --with-gmp \
230 --enable-ftp \
231 --with-gettext \
232 --enable-mbstring \
233 --with-readline &amp;&amp;
234make</userinput></screen>
235
236 <para>
237 To test the results, issue: <command>make test</command>. A few
238 tests may fail, in which case you are asked whether you want to send
239 the report to the PHP developpers. If you want to automate the test,
240 you may prefix the command with <command>yes "n" | </command>.
241 </para>
242
243 <para>
244 Now, as the <systemitem class="username">root</systemitem> user:
245 </para>
246
247<!-- dev note: make INSTALL_ROOT=<DESTDIR> install -->
248
249<screen role="root"><userinput>make install &amp;&amp;
250install -v -m644 php.ini-production /etc/php.ini &amp;&amp;
251mv -v /etc/php-fpm.conf{.default,} &amp;&amp;
252
253install -v -dm755 /usr/share/doc/php-&php-version; &amp;&amp;
254install -v -m644 CODING_STANDARDS EXTENSIONS INSTALL NEWS README* UPGRADING* php.gif \
255 /usr/share/doc/php-&php-version; &amp;&amp;
256ln -sfv /usr/lib/php/doc/Archive_Tar/docs/Archive_Tar.txt \
257 /usr/share/doc/php-&php-version; &amp;&amp;
258ln -sfv /usr/lib/php/doc/Structures_Graph/docs \
259 /usr/share/doc/php-&php-version;</userinput></screen>
260
261 <para>
262 The pre-built HTML documentation is packaged in two forms: a tarball
263 containing many individual files, useful for quick loading into your
264 browser, and one large individual file, which is useful for using the
265 search utility of your browser. If you downloaded either, or both, of the
266 documentation files, issue the following commands as the
267 <systemitem class='username'>root</systemitem> user to install them (note
268 these instructions assume English docs, modify the tarball names below if
269 necessary).
270 </para>
271
272 <para>
273 For the <quote>Single HTML</quote> file:
274 </para>
275
276<screen role="root"><userinput>install -v -m644 ../php_manual_en.html.gz \
277 /usr/share/doc/php-&php-version; &amp;&amp;
278gunzip -v /usr/share/doc/php-&php-version;/php_manual_en.html.gz</userinput></screen>
279
280 <para>
281 For the <quote>Many HTML files</quote> tarball:
282 </para>
283
284<screen role="root"><userinput>tar -xvf ../php_manual_en.tar.gz \
285 -C /usr/share/doc/php-&php-version; --no-same-owner</userinput></screen>
286
287 </sect2>
288
289 <sect2 role="commands">
290 <title>Command Explanations</title>
291
292 <para>
293 <command>sed -i "s|lsystemd-daemon|lsystemd|g" configure</command>:
294 This command fixes the detection of the systemd library.
295 </para>
296
297 <para>
298 <parameter>--with-datadir=/usr/share/php</parameter>: This works
299 around a bug in the build machinery, which installs some data to a
300 wrong location.
301 </para>
302
303 <para>
304 <parameter>--enable-fpm</parameter>: This parameter allows
305 building the fastCGI Process Manager.
306 </para>
307
308 <para>
309 <parameter>--with-fpm-systemd</parameter>: This parameter allows
310 the FastCGI Process Manager to integrate with systemd.
311 </para>
312
313 <para>
314 <parameter>--with-config-file-path=/etc</parameter>: This parameter
315 makes <application>PHP</application> look for the
316 <filename>php.ini</filename> configuration file in
317 <filename class="directory">/etc</filename>.
318 </para>
319
320 <para>
321 <parameter>--with-zlib</parameter>: This parameter adds
322 support for <application>Zlib</application> compression.
323 </para>
324
325 <para>
326 <parameter>--enable-bcmath</parameter>: Enables
327 <command>bc</command> style precision math functions.
328 </para>
329
330 <para>
331 <parameter>--with-bz2</parameter>: Adds support for
332 <application>Bzip2</application> compression functions.
333 </para>
334
335 <para>
336 <parameter>--enable-calendar</parameter>: This parameter
337 provides support for calendar conversion.
338 </para>
339
340 <para>
341 <parameter>--enable-dba=shared</parameter>: This parameter enables
342 support for database (dbm-style) abstraction layer functions.
343 </para>
344
345 <para>
346 <parameter>--enable-ftp</parameter>: This parameter
347 enables FTP functions.
348 </para>
349
350 <para>
351 <parameter>--with-gettext</parameter>: Enables functions
352 that use <application>Gettext</application> text translation.
353 </para>
354
355 <para>
356 <parameter>--enable-mbstring</parameter>: This parameter
357 enables multibyte string support.
358 </para>
359
360 <para>
361 <parameter>--with-readline</parameter>: This parameter
362 enables command line <application>Readline</application> support.
363 </para>
364
365 <para>
366 <option>--with-mysql</option>: This option
367 includes <application>MariaDB/MySQL</application> support.
368 </para>
369
370 <para>
371 <option>--disable-libxml</option>: This option
372 allows building PHP without <application>libxml2</application>
373 installed.
374 </para>
375
376 <para>
377 <option>--with-apxs2</option>: Instead of building the fastCGI process
378 manager, it is possible to build an <application>apache</application>
379 module. This has some performance penalty for heavy loaded servers,
380 but may be easier to set up. This switch is incompatible with the
381 <parameter>--enable-fpm</parameter> and
382 <parameter>--with-fpm-...</parameter> switches.
383 </para>
384
385 </sect2>
386
387 <sect2 role="configuration">
388 <title>Configuring PHP</title>
389
390 <sect3 id="php-config">
391 <title>Config Files</title>
392
393 <para>
394 <filename>/etc/php.ini</filename>,
395 <filename>/etc/pear.conf</filename>, and
396 <filename>/etc/php-fpm.conf</filename>
397 </para>
398
399 <indexterm zone="php php-config">
400 <primary sortas="e-etc-php.ini">/etc/php.ini</primary>
401 </indexterm>
402
403 <indexterm zone="php php-config">
404 <primary sortas="e-etc-pear.conf">/etc/pear.conf</primary>
405 </indexterm>
406
407 <indexterm zone="php php-config">
408 <primary sortas="e-etc-php-fpm.conf">/etc/php-fpm.conf</primary>
409 </indexterm>
410
411 </sect3>
412
413 <sect3>
414 <title>Configuration Information</title>
415
416 <para>
417 The file used as the default <filename>/etc/php.ini</filename>
418 configuration file is recommended by the <application>PHP</application>
419 development team. This file modifies the default behavior of
420 <application>PHP</application>. If no <filename>/etc/php.ini</filename>
421 is used, all configuration settings fall to the defaults. You should
422 review the comments in this file and ensure the changes are acceptable
423 in your particular environment.
424 </para>
425
426 <para>
427 You may have noticed the following from the output of the
428 <command>make install</command> command:
429 </para>
430
431<screen><computeroutput>You may want to add: /usr/lib/php to your php.ini include_path</computeroutput></screen>
432
433 <para>
434 If desired, add the entry using the following command as the
435 <systemitem class="username">root</systemitem> user:
436 </para>
437
438<screen role="root"><userinput>sed -i 's@php/includes"@&amp;\ninclude_path = ".:/usr/lib/php"@' \
439 /etc/php.ini</userinput></screen>
440
441 <para>
442 To enable fastCGI support in the <application>Apache</application>
443 web server, two LoadModule directives must be added to the
444 <filename>httpd.conf</filename> file. They are commented out, so just
445 issue the following command as
446 <systemitem class="username">root</systemitem> user:
447 </para>
448
449<screen role="root"><userinput>sed -e '/proxy_module/s/^#//' \
450 -e '/proxy_fcgi_module/s/^#//' \
451 -i /etc/httpd/httpd.conf</userinput></screen>
452
453 <para>
454 Those modules accept various <command>ProxyPass</command>
455 directives. One possibility is (as the
456 <systemitem class="username">root</systemitem> user):
457 </para>
458
459<screen role="root"><userinput>echo 'ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/srv/www/$1' &gt;&gt; \
460 /etc/httpd/httpd.conf</userinput></screen>
461
462 <para>
463 Additionally, it may be useful to add an entry for
464 <filename>index.php</filename> to the DirectoryIndex directive of the
465 <filename>httpd.conf</filename> file. Lastly, adding a line to setup the
466 <filename class='extension'>.phps</filename> extension to show
467 highlighted <application>PHP</application> source may be
468 desirable:
469 </para>
470
471<screen><literal>AddType application/x-httpd-php-source .phps</literal></screen>
472
473 <para>
474 You'll need to restart the <application>Apache</application> web server
475 after making any modifications to the <filename>httpd.conf</filename>
476 file.
477 </para>
478
479 </sect3>
480
481 <sect3 id="php-init">
482 <title>Systemd Units</title>
483
484 <para>
485 To start the <command>php-fpm</command> daemon at boot,
486 install the systemd unit from the <xref linkend="bootscripts"/>
487 package by running the following command as the
488 <systemitem class="username">root</systemitem> user:
489 </para>
490
491 <indexterm zone="php php-init">
492 <primary sortas="f-php-fpm">php-fpm</primary>
493 </indexterm>
494
495<screen role="root"><userinput>make install-php-fpm</userinput></screen>
496 </sect3>
497
498 </sect2>
499
500 <sect2 role="content">
501 <title>Contents</title>
502
503 <segmentedlist>
504 <segtitle>Installed Programs</segtitle>
505 <segtitle>Installed Libraries</segtitle>
506 <segtitle>Installed Directories</segtitle>
507
508 <seglistitem>
509 <seg>pear, peardev, pecl, phar (symlink), phar.phar,
510 php, php-cgi, php-config, php-fpm, and phpize</seg>
511 <seg>None</seg>
512 <seg>/usr/include/php, /usr/lib/php, /usr/share/php and
513 /usr/share/doc/php-&php-version;</seg>
514 </seglistitem>
515 </segmentedlist>
516
517 <variablelist>
518 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
519 <?dbfo list-presentation="list"?>
520 <?dbhtml list-presentation="table"?>
521
522 <varlistentry id="php-prog">
523 <term><command>php</command></term>
524 <listitem>
525 <para>
526 is a command line interface that enables you to parse and
527 execute PHP code.
528 </para>
529 <indexterm zone="php php-prog">
530 <primary sortas="b-php">php</primary>
531 </indexterm>
532 </listitem>
533 </varlistentry>
534
535 <varlistentry id="pear">
536 <term><command>pear</command></term>
537 <listitem>
538 <para>
539 is the PHP Extension and Application Repository (PEAR) package
540 manager.
541 </para>
542 <indexterm zone="php pear">
543 <primary sortas="b-pear">pear</primary>
544 </indexterm>
545 </listitem>
546 </varlistentry>
547
548 <varlistentry id="php-fpm">
549 <term><command>php-fpm</command></term>
550 <listitem>
551 <para>
552 is the fastCGI process manager for PHP.
553 </para>
554 <indexterm zone="php php-fpm">
555 <primary sortas="b-php-fpm">php-fpm</primary>
556 </indexterm>
557 </listitem>
558 </varlistentry>
559
560 </variablelist>
561
562 </sect2>
563
564</sect1>
Note: See TracBrowser for help on using the repository browser.