source: general/prog/php.xml@ 7ea6667

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 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 7ea6667 was e797436, checked in by Randy McMurchy <randy@…>, 18 years ago

Updated to PHP-5.1.4

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

  • Property mode set to 100644
File size: 17.3 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3 "http://www.oasis-open.org/docbook/xml/4.4/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 "ftp://ftp.isu.edu.tw/pub/Unix/Web/PHP/distributions/php-&php-version;.tar.bz2">
9 <!ENTITY php-md5sum "66a806161d4a2d3b5153ebe4cd0f2e1c">
10 <!ENTITY php-size "6.3 MB">
11 <!ENTITY php-buildsize "213 MB (includes installing all documentation)">
12 <!ENTITY php-time "2.5 SBU (additional 1.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 <keywordset>
22 <keyword role="package">php-&php-version;.tar</keyword>
23 <keyword role="ftpdir">php</keyword>
24 </keywordset>
25 </sect1info>
26
27 <title>PHP-&php-version;</title>
28
29 <indexterm zone="php">
30 <primary sortas="a-PHP">PHP</primary>
31 </indexterm>
32
33 <sect2 role="package">
34 <title>Introduction to PHP</title>
35
36 <para><application>PHP</application> is the PHP Hypertext Preprocessor.
37 Primarily used in dynamic web sites, it allows for programming code to be
38 directly embedded into the HTML markup.</para>
39
40 <bridgehead renderas="sect3">Package Information</bridgehead>
41 <itemizedlist spacing="compact">
42 <listitem>
43 <para>Download (HTTP): <ulink url="&php-download-http;"/></para>
44 </listitem>
45 <listitem>
46 <para>Download (FTP): <ulink url="&php-download-ftp;"/></para>
47 </listitem>
48 <listitem>
49 <para>Download MD5 sum: &php-md5sum;</para>
50 </listitem>
51 <listitem>
52 <para>Download size: &php-size;</para>
53 </listitem>
54 <listitem>
55 <para>Estimated disk space required: &php-buildsize;</para>
56 </listitem>
57 <listitem>
58 <para>Estimated build time: &php-time;</para>
59 </listitem>
60 </itemizedlist>
61
62 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
63 <itemizedlist spacing="compact">
64 <!-- <listitem>
65 <para>Required patch for Berkeley DB: <ulink
66 url="&patch-root;/php-&php-version;-db43-1.patch"/></para>
67 </listitem> -->
68 <listitem>
69 <para>Pre-built documentation (optional): <ulink
70 url="http://www.php.net/download-docs.php"/></para>
71 </listitem>
72 </itemizedlist>
73
74 <bridgehead renderas="sect3">PHP Dependencies</bridgehead>
75
76 <bridgehead renderas="sect4">Required</bridgehead>
77 <para role="required"><xref linkend="apache"/></para>
78
79 <bridgehead renderas="sect4">Recommended</bridgehead>
80 <para role="recommended"><xref linkend="libxml2"/></para>
81
82 <bridgehead renderas="sect4">Optional System Utilities and Libraries</bridgehead>
83 <para role="optional"><xref linkend="libxslt"/>,
84 <!-- <xref linkend="gamin"/>, -->
85 <xref linkend="gmp"/>,
86 <xref linkend="pcre"/>,
87 <xref linkend="aspell"/>,
88 <xref linkend="pkgconfig"/>,
89 <xref linkend="expat"/> (deprecated alternative to <xref linkend="libxml2"/>),
90 <ulink url="http://www.ossp.org/pkg/lib/mm/">OSSP mm</ulink>,
91 <ulink url="http://www.net-snmp.org/">Net-SNMP</ulink>,
92 <ulink url="http://www.gnu.org/software/pth/">GNU Pth</ulink>,
93 <ulink url="http://re2c.org/">re2c</ulink>,
94 <ulink url="http://dmalloc.com/">Dmalloc</ulink>,
95 <ulink url="http://www.gnu.org/software/recode/">recode</ulink>, and
96 <xref linkend="sendmail"/> (or another
97 <ulink url="../server/mail.html">MTA</ulink> 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="http://www.boutell.com/gd/">GD</ulink>,
109 <ulink url="http://gd.tuwien.ac.at/visual/ibiblio/libs/graphics/t1lib-5.1.0.tar.gz">
110 t1lib</ulink>, and
111 <ulink url="http://partners.adobe.com/asn/acrobat/forms.jsp">FDF Toolkit</ulink></para>
112
113 <bridgehead renderas="sect4">Optional Web Utilities</bridgehead>
114 <para role="optional"><xref linkend="curl"/>,
115 <xref linkend="html-tidy"/>,
116 <ulink url="http://www.mnogosearch.org/">mnoGoSearch</ulink>,
117 <ulink url="http://www.hyperwave.com/">Hyperwave</ulink>,
118 <ulink url="http://www.roxen.com/products/webserver/">Roxen WebServer</ulink>,
119 <ulink url="http://caudium.net/">Caudium</ulink>, and
120 <ulink url="http://www.openwddx.org/">WDDX</ulink></para>
121
122 <bridgehead renderas="sect4">Optional Data Management Utilities and Libraries</bridgehead>
123 <para role="optional"><xref linkend="openldap"/>,
124 <xref linkend="gdbm"/>,
125 <!-- <xref linkend="db"/>, -->
126 <xref linkend="mysql"/>,
127 <xref linkend="postgresql"/>,
128 <xref linkend="unixodbc"/>,
129 <ulink url="http://qdbm.sourceforge.net/">QDBM</ulink>,
130 <ulink url="http://cr.yp.to/cdb.html">cdb</ulink>,
131 <ulink url="http://www.sqlite.org/">SQLite</ulink>,
132 <ulink url="http://www.hughes.com.au/products/msql/">Mini SQL</ulink>,
133 <ulink url="http://www.empress.com/">Empress</ulink>,
134 <ulink url="http://www.birdstep.com/">Birdstep</ulink>,
135 <ulink url="http://www.dbmaker.com/">DBMaker</ulink>,
136 <ulink url="http://www.softwareag.com/">Adabas</ulink>,
137 <ulink url="http://www.frontbase.com/">FrontBase</ulink>, and
138 <ulink url="http://www.mainstreetsoftworks.com/">Monetra</ulink></para>
139
140 <para><application>PHP</application> also provides support for many
141 commercial database tools such as <application>Oracle</application>,
142 <application>SAP</application> and
143 <application>ODBC Router</application>.</para>
144
145 <bridgehead renderas="sect4">Optional Security/Encryption Utilities and Libraries</bridgehead>
146 <para role="optional"><xref linkend="openssl"/>,
147 <xref linkend="cyrus-sasl"/>,
148 <xref linkend="mitkrb"/> or <xref linkend="heimdal"/>,
149 <ulink url="http://mcrypt.sourceforge.net/">libmcrypt</ulink>, and
150 <ulink url="http://mhash.sourceforge.net/">mhash</ulink></para>
151
152 <para condition="html" role="usernotes">User Notes:
153 <ulink url="&blfs-wiki;/php"/></para>
154
155 </sect2>
156
157 <sect2 role="installation">
158 <title>Installation of PHP</title>
159
160 <para>You can use <application>PHP</application> for server-side
161 scripting, command-line scripting or client-side GUI applications. This
162 book provides instructions for setting up <application>PHP</application>
163 for server-side scripting as it is the most common form.</para>
164
165 <!-- Commenting this out for now as BDB is built in LFS
166
167 <para>If you have <application>Berkeley DB</application> installed and
168 wish to utilize it, apply the following patch:</para>
169
170<screen><userinput>patch -Np1 -i ../php-&php-version;-db43-1.patch</userinput></screen>
171
172 -->
173
174 <note>
175 <para><application>PHP</application> has many more
176 <command>configure</command> options that will enable support for various
177 things. You can use <command>./configure --help</command> to see a full
178 list of the available options. Also, use of the
179 <ulink url="http://www.php.net/">PHP web site</ulink>
180 is highly recommended, as their online docs are very good. An example of
181 a <command>configure</command> command that utilizes many of the most
182 common dependencies can be found at <ulink
183 url="http://anduin.linuxfromscratch.org/files/BLFS/php_configure.txt"/>.
184 </para>
185
186 <para>If, for whatever reason, you don't have <xref linkend="libxml2"/>
187 installed, you need to add <option>--disable-libxml</option> to the
188 <command>configure</command> command in the instructions below. Note that
189 this will prevent the <command>pear</command> command from being
190 built.</para>
191 </note>
192
193 <!-- Commenting this out as libxml is a recommended dependency.
194 Current protocol in the book is to expect folks to have it
195 installed and the note above should take care of it.
196
197 <para>Remove the <parameter>-disable-libxml</parameter> switch if you
198 have <xref linkend="libxml2"/> installed otherwise
199 <command>pear</command> will not be built.</para>
200 -->
201
202 <para>Install <application>PHP</application> by
203 running the following commands:</para>
204
205<screen><userinput>sed -i 's/const char \*errpfx,/const DB_ENV *dbenv, &amp; const/' \
206 ext/dba/dba_db4.c &amp;&amp;
207./configure --prefix=/usr \
208 --sysconfdir=/etc \
209 --with-apxs2 \
210 --enable-force-cgi-redirect \
211 --enable-discard-path \
212 --with-config-file-path=/etc \
213 --with-zlib \
214 --enable-bcmath \
215 --with-bz2 \
216 --enable-calendar \
217 --enable-dba \
218 --enable-exif \
219 --enable-ftp \
220 --with-gettext \
221 --enable-mbstring \
222 --with-ncurses \
223 --with-readline &amp;&amp;
224make</userinput></screen>
225
226 <para>To test the results, issue: <command>make test</command>. Three of
227 the (over 1600) tests are known to fail: an <command>iconv</command>
228 stream filter test (ext/iconv/tests/iconv_stream_filter.phpt) and two
229 MBString function overload tests (ext/mbstring/tests/overload01.phpt and
230 ext/mbstring/tests/overload02.phpt). Additionally, if you have the
231 <application>unixODBC</application> package installed and linked into the
232 build, you may see many failures related to it.</para>
233
234 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
235
236<screen role="root"><userinput>make install &amp;&amp;
237install -v -m644 php.ini-recommended /etc/php.ini &amp;&amp;
238install -v -m755 -d /usr/share/doc/php-&php-version; &amp;&amp;
239install -v -m644 CODING_STANDARDS EXTENSIONS INSTALL NEWS \
240 README* TODO* UPGRADING php.gif \
241 /usr/share/doc/php-&php-version; &amp;&amp;
242ln -v -s /usr/lib/php/doc/Archive_Tar/docs/Archive_Tar.txt \
243 /usr/share/doc/php-&php-version;</userinput></screen>
244
245 <para>The pre-built HTML documentation is packaged in two forms: a tarball
246 containing many individual files, useful for quick loading into your
247 browser, and one large individual file, which is useful for using the
248 search utility of your browser. If you downloaded either, or both, of the
249 documentation files, issue the following commands as the
250 <systemitem class='username'>root</systemitem> user to install them (note
251 these instructions assume English docs, modify the tarball names below if
252 necessary).</para>
253
254 <para>For the <quote>Single HTML</quote> file:</para>
255
256<screen role="root"><userinput>install -v -m644 ../php_manual_en.html.gz \
257 /usr/share/doc/php-&php-version; &amp;&amp;
258gunzip -v /usr/share/doc/php-&php-version;/php_manual_en.html.gz</userinput></screen>
259
260 <para>For the <quote>Many HTML files</quote> tarball:</para>
261
262<screen role="root"><userinput>tar -xvf ../php_manual_en.tar.gz -C /usr/share/doc/php-&php-version; &amp;&amp;
263chown -v -R root:root /usr/share/doc/php-&php-version;/html</userinput></screen>
264
265 </sect2>
266
267 <sect2 role="commands">
268 <title>Command Explanations</title>
269
270 <para><command>sed -i '...' ext/dba/dba_db4.c</command>: This command is
271 used to fix an issue with the use of Berkeley DB &gt;= 4.3.x.</para>
272
273 <para><parameter>--with-apxs2</parameter>: This parameter
274 builds the Apache HTTPD 2.0 module.</para>
275
276 <para><parameter>--with-config-file-path=/etc</parameter>: This parameter
277 makes <application>PHP</application> look for the
278 <filename>php.ini</filename> configuration file in
279 <filename class='directory'>/etc</filename>.</para>
280
281 <para><parameter>--with-zlib</parameter>: This parameter adds
282 support for <application>Zlib</application> compression.</para>
283
284 <para><parameter>--enable-bcmath</parameter>: Enables
285 <command>bc</command> style precision math functions.</para>
286
287 <para><parameter>--with-bz2</parameter>: Adds support for
288 <application>Bzip2</application> compression functions.</para>
289
290 <para><parameter>--enable-calendar</parameter>: This parameter
291 provides support for calendar conversion.</para>
292
293 <para><parameter>--enable-dba</parameter>: This parameter enables
294 support for database (dbm-style) abstraction layer functions.</para>
295
296 <para><parameter>--enable-exif</parameter>: Enables functions
297 to access metadata from images.</para>
298
299 <para><parameter>--enable-ftp</parameter>: This parameter
300 enables FTP functions.</para>
301
302 <para><parameter>--with-gettext</parameter>: Enables functions
303 that use <application>Gettext</application> text translation.</para>
304
305 <para><parameter>--enable-mbstring</parameter>: This parameter
306 enables multibyte string support.</para>
307
308 <para><parameter>--with-ncurses</parameter>: Provides ncurses
309 terminal independent cursor handling.</para>
310
311 <para><parameter>--with-readline</parameter>: This parameter
312 enables command line <application>Readline</application> support.</para>
313
314 <para><parameter>--disable-libxml</parameter>: This parameter
315 allows building PHP without <application>libxml2</application>
316 installed.</para>
317
318 </sect2>
319
320 <sect2 role="configuration">
321 <title>Configuring PHP</title>
322
323 <sect3 id="php-config">
324 <title>Config Files</title>
325
326 <para><filename>/etc/php.ini</filename> and
327 <filename>/etc/pear.conf</filename></para>
328
329 <indexterm zone="php php-config">
330 <primary sortas="e-etc-php.ini">/etc/php.ini</primary>
331 </indexterm>
332
333 <indexterm zone="php php-config">
334 <primary sortas="e-etc-pear.conf">/etc/pear.conf</primary>
335 </indexterm>
336
337 </sect3>
338
339 <sect3>
340 <title>Configuration Information</title>
341
342 <para>The file used as the default <filename>/etc/php.ini</filename>
343 configuration file is recommended by the <application>PHP</application>
344 development team. This file modifies the default behavior of
345 <application>PHP</application> if no <filename>/etc/php.ini</filename>
346 is used and all configuration settings fall to the defaults. You should
347 review the comments in this file and ensure the changes are acceptable
348 in your particular environment.</para>
349
350 <para>You may have noticed the following from the output of the
351 <command>make install</command> command:</para>
352
353<screen><computeroutput>You may want to add: /usr/lib/php to your php.ini include_path</computeroutput></screen>
354
355 <para>If desired, add the entry using the following command as the
356 <systemitem class="username">root</systemitem> user:</para>
357
358<screen role="root"><userinput>sed -i 's@php/includes"@&amp;\ninclude_path = ".:/usr/lib/php"@' \
359 /etc/php.ini</userinput></screen>
360
361 <para>To enable PHP support in the <application>Apache</application>
362 web server, a new LoadModule (which should be handled automatically by the
363 <command>make install</command> command) and AddType directives
364 must be added to the <filename>httpd.conf</filename> file:</para>
365
366<screen><literal>LoadModule php5_module lib/apache/libphp5.so
367AddType application/x-httpd-php .php</literal></screen>
368
369 <para>Additionally, it can be useful to add an entry for
370 <filename>index.php</filename> to the DirectoryIndex directive of the
371 <filename>httpd.conf</filename> file. Lastly, adding a line to setup the
372 <filename class='extension'>.phps</filename> extension to show
373 highlighted <application>PHP</application> source may be
374 desirable:</para>
375
376<screen><literal>AddType application/x-httpd-php-source .phps</literal></screen>
377
378 <para>You'll need to restart the <application>Apache</application> web server
379 after making any modifications to the <filename>httpd.conf</filename>
380 file.</para>
381
382 </sect3>
383
384 </sect2>
385
386 <sect2 role="content">
387 <title>Contents</title>
388
389 <segmentedlist>
390 <segtitle>Installed Programs</segtitle>
391 <segtitle>Installed Library</segtitle>
392 <segtitle>Installed Directories</segtitle>
393
394 <seglistitem>
395 <seg>pear, peardev, pecl, php, php-config and phpize</seg>
396 <seg>libphp5.so Apache module</seg>
397 <seg>/usr/include/php, /usr/lib/php and
398 /usr/share/doc/php-&php-version;</seg>
399 </seglistitem>
400 </segmentedlist>
401
402 <variablelist>
403 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
404 <?dbfo list-presentation="list"?>
405 <?dbhtml list-presentation="table"?>
406
407 <varlistentry id="php-prog">
408 <term><command>php</command></term>
409 <listitem>
410 <para>is a command line interface that enables you to parse and
411 execute PHP code.</para>
412 <indexterm zone="php php-prog">
413 <primary sortas="b-php">php</primary>
414 </indexterm>
415 </listitem>
416 </varlistentry>
417
418 <varlistentry id="pear">
419 <term><command>pear</command></term>
420 <listitem>
421 <para>is the PHP Extension and Application
422 Repository (PEAR) package manager.</para>
423 <indexterm zone="php pear">
424 <primary sortas="b-pear">pear</primary>
425 </indexterm>
426 </listitem>
427 </varlistentry>
428
429 </variablelist>
430
431 </sect2>
432
433</sect1>
Note: See TracBrowser for help on using the repository browser.