source: general/prog/php.xml@ 4f161b1

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 4f161b1 was 4f161b1, checked in by Pierre Labastie <pieere@…>, 10 years ago

Add patches to php and mitkrb, against possible vulnerabilities

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

  • Property mode set to 100644
File size: 16.1 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://us2.php.net/distributions/php-&php-version;.tar.bz2">
8 <!ENTITY php-download-ftp " ">
9 <!ENTITY php-md5sum "c4a348a07b52f6e177d8fdc75fe507b1">
10 <!ENTITY php-size "13 MB">
11 <!ENTITY php-buildsize "391 MB">
12 <!ENTITY php-time "3.6 SBU (additional 2.9 SBU to run the test suite)">
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><application>PHP</application> is the PHP Hypertext Preprocessor.
33 Primarily used in dynamic web sites, it allows for programming code to be
34 directly embedded into the HTML markup. It is also useful as a
35 general purpose scripting language.</para>
36
37 &lfs75_checked;
38
39 <bridgehead renderas="sect3">Package Information</bridgehead>
40 <itemizedlist spacing="compact">
41 <listitem>
42 <para>Download (HTTP): <ulink url="&php-download-http;"/></para>
43 </listitem>
44 <listitem>
45 <para>Download (FTP): <ulink url="&php-download-ftp;"/></para>
46 </listitem>
47 <listitem>
48 <para>Download MD5 sum: &php-md5sum;</para>
49 </listitem>
50 <listitem>
51 <para>Download size: &php-size;</para>
52 </listitem>
53 <listitem>
54 <para>Estimated disk space required: &php-buildsize;</para>
55 </listitem>
56 <listitem>
57 <para>Estimated build time: &php-time;</para>
58 </listitem>
59 </itemizedlist>
60
61 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
62 <itemizedlist spacing="compact">
63 <listitem>
64 <para>Pre-built documentation (optional): <ulink
65 url="http://www.php.net/download-docs.php"/></para>
66 </listitem>
67 <listitem>
68 <para>
69 Required patch:
70 <ulink url="&patch-root;/php-&php-version;-libmagic_fix-1.patch"/>
71 </para>
72 </listitem>
73
74 </itemizedlist>
75
76 <bridgehead renderas="sect3">PHP Dependencies</bridgehead>
77
78 <bridgehead renderas="sect4">Recommended</bridgehead>
79 <para role="recommended">
80 <xref linkend="apache"/> and
81 <xref linkend="libxml2"/>
82 </para>
83
84 <bridgehead renderas="sect4">Optional System Utilities and Libraries</bridgehead>
85 <para role="optional"><xref linkend="libxslt"/>,
86 <!-- <xref linkend="gamin"/>, -->
87 <xref linkend="pcre"/>,
88 <xref linkend="aspell"/>,
89 <xref linkend="enchant"/>,
90 <xref linkend="expat"/> (deprecated alternative to <xref linkend="libxml2"/>),
91 <ulink url="http://www.ossp.org/pkg/lib/mm/">OSSP mm</ulink>,
92 <ulink url="http://www.net-snmp.org/">Net-SNMP</ulink>,
93 <xref linkend="pth"/>,
94 <ulink url="http://re2c.org/">re2c</ulink>,
95 <ulink url="http://xmlrpc-epi.sourceforge.net/main.php?t=php_about">XMLRPC-EPI</ulink>,
96 <ulink url="http://dmalloc.com/">Dmalloc</ulink>, and
97 an <xref linkend="server-mail"/> (that provides a
98 <command>sendmail</command> command)</para>
99
100 <bridgehead renderas="sect4">Optional Graphics Utilities and Libraries</bridgehead>
101 <para role="optional"><xref linkend="libjpeg"/>,
102 <xref linkend="libtiff"/>,
103 <xref linkend="libpng"/>,
104 <xref linkend="libexif"/>,
105 <xref linkend="freetype2"/>,
106 <xref linkend="x-window-system"/>,
107 <ulink url="http://www.fastio.com/">ClibPDF</ulink>,
108 <ulink url="https://bitbucket.org/libgd/gd-libgd/downloads">GD</ulink>,
109 <ulink url="http://fossies.org/linux/misc/t1lib-5.1.2.tar.gz/">t1lib</ulink>, and
110 <ulink url="http://partners.adobe.com/asn/acrobat/forms.jsp">FDF Toolkit</ulink></para>
111
112 <bridgehead renderas="sect4">Optional Web Utilities</bridgehead>
113 <para role="optional"><xref linkend="curl"/>,
114 <xref linkend="html-tidy"/>,
115 <ulink url="http://www.mnogosearch.org/">mnoGoSearch</ulink>,
116 <ulink url="http://www.hyperwave.com/">Hyperwave</ulink>,
117 <ulink url="http://www.roxen.com/products/webserver/">Roxen WebServer</ulink>,
118 <ulink url="http://sourceforge.net/projects/caudium/">Caudium</ulink>, and
119 <ulink url="https://wddxnet.codeplex.com/">WDDX</ulink></para>
120
121 <bridgehead renderas="sect4">Optional Data Management Utilities and Libraries</bridgehead>
122 <para role="optional"><xref linkend="openldap"/>,
123 <!-- <xref linkend="gdbm"/>, -->
124 <xref linkend="db"/>,
125 <xref linkend="mariadb"/> or <xref linkend="mysql"/>,
126 <xref linkend="postgresql"/>,
127 <xref linkend="unixodbc"/>,
128 <xref linkend="sqlite"/>,
129 <ulink url="http://sourceforge.net/projects/qdbm">QDBM</ulink>,
130 <ulink url="http://cr.yp.to/cdb.html">cdb</ulink>,
131 <ulink url="http://www.hughes.com.au/products/msql/">Mini SQL</ulink>,
132 <ulink url="http://www.empress.com/">Empress</ulink>,
133 <ulink url="http://www.birdstep.com/">Birdstep</ulink>,
134 <ulink url="http://www.dbmaker.com/">DBMaker</ulink>,
135 <ulink url="http://www.softwareag.com/">Adabas</ulink>,
136 <ulink url="http://www.frontbase.com/">FrontBase</ulink>, and
137 <ulink url="http://www.mainstreetsoftworks.com/">Monetra</ulink></para>
138
139 <para><application>PHP</application> also provides support for many
140 commercial database tools such as <application>Oracle</application>,
141 <application>SAP</application> and
142 <application>ODBC Router</application>.</para>
143
144 <bridgehead renderas="sect4">Optional Security/Encryption Utilities and Libraries</bridgehead>
145 <para role="optional"><xref linkend="openssl"/>,
146 <xref linkend="cyrus-sasl"/>,
147 <xref linkend="mitkrb"/>,
148 <ulink url="http://mcrypt.sourceforge.net/">libmcrypt</ulink>, and
149 <ulink url="http://mhash.sourceforge.net/">mhash</ulink></para>
150
151 <para condition="html" role="usernotes">User Notes:
152 <ulink url="&blfs-wiki;/php"/></para>
153
154 </sect2>
155
156 <sect2 role="installation">
157 <title>Installation of PHP</title>
158
159 <para>You can use <application>PHP</application> for server-side
160 scripting, command-line scripting or client-side GUI applications. This
161 book provides instructions for setting up <application>PHP</application>
162 for server-side scripting as it is the most common form.</para>
163
164 <note>
165 <para><application>PHP</application> has many more
166 <command>configure</command> options that will enable support for various
167 things. You can use <command>./configure --help</command> to see a full
168 list of the available options. Also, use of the
169 <ulink url="http://www.php.net/">PHP web site</ulink>
170 is highly recommended, as their online docs are very good. An example of
171 a <command>configure</command> command that utilizes many of the most
172 common dependencies can be found at <ulink
173 url="&files-anduin;/php_configure.txt"/>.
174 </para>
175
176 <para>If, for whatever reason, you don't have <xref linkend="libxml2"/>
177 installed, you need to add <option>--disable-libxml</option> to the
178 <command>configure</command> command in the instructions below. Note that
179 this will prevent the <command>pear</command> command from being
180 built.</para>
181 </note>
182
183 <para>Install <application>PHP</application> by
184 running the following commands:</para>
185
186<screen><userinput>patch -Np1 -i ../php-&php-version;-libmagic_fix-1.patch &amp;&amp;
187sed -i -e 's/2.6.5 2.7/&amp; 3.0/' configure &amp;&amp;
188./configure --prefix=/usr \
189 --sysconfdir=/etc \
190 --mandir=/usr/share/man \
191 --with-apxs2 \
192 --with-config-file-path=/etc \
193 --with-zlib \
194 --enable-bcmath \
195 --with-bz2 \
196 --enable-calendar \
197 --enable-dba=shared \
198 --with-gdbm \
199 --with-gmp \
200 --enable-ftp \
201 --with-gettext \
202 --enable-mbstring \
203 --with-readline &amp;&amp;
204make</userinput></screen>
205
206 <para>To test the results, issue: <command>make test</command>. A few
207 tests may fail.</para>
208
209 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
210
211<!-- dev note: make INSTALL_ROOT=<DESTDIR> install -->
212
213<screen role="root"><userinput>make install &amp;&amp;
214install -v -m644 php.ini-production /etc/php.ini &amp;&amp;
215
216install -v -m755 -d /usr/share/doc/php-&php-version; &amp;&amp;
217install -v -m644 CODING_STANDARDS EXTENSIONS INSTALL NEWS README* UPGRADING* php.gif \
218 /usr/share/doc/php-&php-version; &amp;&amp;
219ln -v -sfn /usr/lib/php/doc/Archive_Tar/docs/Archive_Tar.txt \
220 /usr/share/doc/php-&php-version; &amp;&amp;
221ln -v -sfn /usr/lib/php/doc/Structures_Graph/docs \
222 /usr/share/doc/php-&php-version;</userinput></screen>
223
224 <para>The pre-built HTML documentation is packaged in two forms: a tarball
225 containing many individual files, useful for quick loading into your
226 browser, and one large individual file, which is useful for using the
227 search utility of your browser. If you downloaded either, or both, of the
228 documentation files, issue the following commands as the
229 <systemitem class='username'>root</systemitem> user to install them (note
230 these instructions assume English docs, modify the tarball names below if
231 necessary).</para>
232
233 <para>For the <quote>Single HTML</quote> file:</para>
234
235<screen role="root"><userinput>install -v -m644 ../php_manual_en.html.gz \
236 /usr/share/doc/php-&php-version; &amp;&amp;
237gunzip -v /usr/share/doc/php-&php-version;/php_manual_en.html.gz</userinput></screen>
238
239 <para>For the <quote>Many HTML files</quote> tarball:</para>
240
241<screen role="root"><userinput>tar -xvf ../php_manual_en.tar.gz \
242 -C /usr/share/doc/php-&php-version; --no-same-owner</userinput></screen>
243
244 </sect2>
245
246 <sect2 role="commands">
247 <title>Command Explanations</title>
248
249 <para><command>sed -i -e 's/2.6.5 2.7/&amp; 3.0/' configure</command>: Make
250 <filename>configure</filename> accept the version 3.0 of
251 <application>Bison</application> as a valid version.</para>
252
253 <para><parameter>--with-apxs2</parameter>: This parameter
254 builds the Apache HTTPD 2.0 module.</para>
255
256 <para><parameter>--with-config-file-path=/etc</parameter>: This parameter
257 makes <application>PHP</application> look for the
258 <filename>php.ini</filename> configuration file in
259 <filename class='directory'>/etc</filename>.</para>
260
261 <para><parameter>--with-zlib</parameter>: This parameter adds
262 support for <application>Zlib</application> compression.</para>
263
264 <para><parameter>--enable-bcmath</parameter>: Enables
265 <command>bc</command> style precision math functions.</para>
266
267 <para><parameter>--with-bz2</parameter>: Adds support for
268 <application>Bzip2</application> compression functions.</para>
269
270 <para><parameter>--enable-calendar</parameter>: This parameter
271 provides support for calendar conversion.</para>
272
273 <para><parameter>--enable-dba=shared</parameter>: This parameter enables
274 support for database (dbm-style) abstraction layer functions.</para>
275
276 <para><parameter>--enable-ftp</parameter>: This parameter
277 enables FTP functions.</para>
278
279 <para><parameter>--with-gettext</parameter>: Enables functions
280 that use <application>Gettext</application> text translation.</para>
281
282 <para><parameter>--enable-mbstring</parameter>: This parameter
283 enables multibyte string support.</para>
284
285 <para><parameter>--with-readline</parameter>: This parameter
286 enables command line <application>Readline</application> support.</para>
287
288 <para><option>--disable-libxml</option>: This option
289 allows building PHP without <application>libxml2</application>
290 installed.</para>
291
292 </sect2>
293
294 <sect2 role="configuration">
295 <title>Configuring PHP</title>
296
297 <sect3 id="php-config">
298 <title>Config Files</title>
299
300 <para><filename>/etc/php.ini</filename> and
301 <filename>/etc/pear.conf</filename></para>
302
303 <indexterm zone="php php-config">
304 <primary sortas="e-etc-php.ini">/etc/php.ini</primary>
305 </indexterm>
306
307 <indexterm zone="php php-config">
308 <primary sortas="e-etc-pear.conf">/etc/pear.conf</primary>
309 </indexterm>
310
311 </sect3>
312
313 <sect3>
314 <title>Configuration Information</title>
315
316 <para>The file used as the default <filename>/etc/php.ini</filename>
317 configuration file is recommended by the <application>PHP</application>
318 development team. This file modifies the default behavior of
319 <application>PHP</application>. If no <filename>/etc/php.ini</filename>
320 is used, all configuration settings fall to the defaults. You should
321 review the comments in this file and ensure the changes are acceptable
322 in your particular environment.</para>
323
324 <para>You may have noticed the following from the output of the
325 <command>make install</command> command:</para>
326
327<screen><computeroutput>You may want to add: /usr/lib/php to your php.ini include_path</computeroutput></screen>
328
329 <para>If desired, add the entry using the following command as the
330 <systemitem class="username">root</systemitem> user:</para>
331
332<screen role="root"><userinput>sed -i 's@php/includes"@&amp;\ninclude_path = ".:/usr/lib/php"@' \
333 /etc/php.ini</userinput></screen>
334
335 <para>To enable PHP support in the <application>Apache</application>
336 web server, a new LoadModule (which should be handled automatically by the
337 <command>make install</command> command) and AddType directives
338 must be added to the <filename>httpd.conf</filename> file:</para>
339
340<screen><literal>LoadModule php5_module lib/apache/libphp5.so
341AddType application/x-httpd-php .php</literal></screen>
342
343 <para>Additionally, it can be useful to add an entry for
344 <filename>index.php</filename> to the DirectoryIndex directive of the
345 <filename>httpd.conf</filename> file. Lastly, adding a line to setup the
346 <filename class='extension'>.phps</filename> extension to show
347 highlighted <application>PHP</application> source may be
348 desirable:</para>
349
350<screen><literal>AddType application/x-httpd-php-source .phps</literal></screen>
351
352 <para>You'll need to restart the <application>Apache</application> web server
353 after making any modifications to the <filename>httpd.conf</filename>
354 file.</para>
355
356 </sect3>
357
358 </sect2>
359
360 <sect2 role="content">
361 <title>Contents</title>
362
363 <segmentedlist>
364 <segtitle>Installed Programs</segtitle>
365 <segtitle>Installed Library</segtitle>
366 <segtitle>Installed Directories</segtitle>
367
368 <seglistitem>
369 <seg>pear, peardev, pecl, phar, phar.phar, php, php-cgi, php-config, and phpize</seg>
370 <seg>libphp5.so Apache module</seg>
371 <seg>/usr/include/php, /usr/lib/php and
372 /usr/share/doc/php-&php-version;</seg>
373 </seglistitem>
374 </segmentedlist>
375
376 <variablelist>
377 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
378 <?dbfo list-presentation="list"?>
379 <?dbhtml list-presentation="table"?>
380
381 <varlistentry id="php-prog">
382 <term><command>php</command></term>
383 <listitem>
384 <para>is a command line interface that enables you to parse and
385 execute PHP code.</para>
386 <indexterm zone="php php-prog">
387 <primary sortas="b-php">php</primary>
388 </indexterm>
389 </listitem>
390 </varlistentry>
391
392 <varlistentry id="pear">
393 <term><command>pear</command></term>
394 <listitem>
395 <para>is the PHP Extension and Application
396 Repository (PEAR) package manager.</para>
397 <indexterm zone="php pear">
398 <primary sortas="b-pear">pear</primary>
399 </indexterm>
400 </listitem>
401 </varlistentry>
402
403 </variablelist>
404
405 </sect2>
406
407</sect1>
Note: See TracBrowser for help on using the repository browser.