source: general/prog/php.xml@ c35d927

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 c35d927 was 2f65edb, checked in by Igor Živković <igor@…>, 19 years ago

Updated to PHP-5.0.5.

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

  • Property mode set to 100644
File size: 13.8 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 "b5d4ca75bbb11ee5b830fa67213d9f7f">
10 <!ENTITY php-size "4.7 MB">
11 <!ENTITY php-buildsize "138 MB">
12 <!ENTITY php-time "1.9 SBU">
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.</para>
35
36 <bridgehead renderas="sect3">Package Information</bridgehead>
37 <itemizedlist spacing="compact">
38 <listitem>
39 <para>Download (HTTP): <ulink url="&php-download-http;"/></para>
40 </listitem>
41 <listitem>
42 <para>Download (FTP): <ulink url="&php-download-ftp;"/></para>
43 </listitem>
44 <listitem>
45 <para>Download MD5 sum: &php-md5sum;</para>
46 </listitem>
47 <listitem>
48 <para>Download size: &php-size;</para>
49 </listitem>
50 <listitem>
51 <para>Estimated disk space required: &php-buildsize;</para>
52 </listitem>
53 <listitem>
54 <para>Estimated build time: &php-time;</para>
55 </listitem>
56 </itemizedlist>
57
58 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
59 <itemizedlist spacing="compact">
60 <listitem>
61 <para>Required patch for Berkeley DB: <ulink
62 url="&patch-root;/php-&php-version;-db43-1.patch"/></para>
63 </listitem>
64 <listitem>
65 <para>Pre-built documentation (optional): <ulink
66 url="http://www.php.net/download-docs.php"/></para>
67 </listitem>
68 </itemizedlist>
69
70 <bridgehead renderas="sect3">PHP Dependencies</bridgehead>
71
72 <bridgehead renderas="sect4">Required</bridgehead>
73 <para><xref linkend="apache"/></para>
74
75 <bridgehead renderas="sect4">Recommended</bridgehead>
76 <para><xref linkend="libxml2"/></para>
77
78 <bridgehead renderas="sect4">Optional System Utilities and Libraries</bridgehead>
79 <para><xref linkend="libxslt"/>,
80 <xref linkend="gamin"/>,
81 <xref linkend="gmp"/>,
82 <xref linkend="pcre"/>,
83 <xref linkend="aspell"/>,
84 <xref linkend="pkgconfig"/>,
85 <xref linkend="expat"/> (deprecated alternative to <xref linkend="libxml2"/>),
86 <ulink url="http://www.ossp.org/pkg/lib/mm/">OSSP mm</ulink>,
87 <ulink url="http://www.net-snmp.org/">Net-SNMP</ulink>,
88 <ulink url="http://dmalloc.com/">Dmalloc</ulink>,
89 <ulink url="http://www.gnu.org/software/recode/">recode</ulink> and
90 an <ulink url="../server/mail.html">MTA</ulink></para>
91
92 <bridgehead renderas="sect4">Optional Graphics Utilities and Libraries</bridgehead>
93 <para><xref linkend="libjpeg"/>,
94 <xref linkend="libtiff"/>,
95 <xref linkend="libpng"/>,
96 <xref linkend="freetype2"/>,
97 X (<xref linkend="xorg"/> or <xref linkend="xfree86"/>),
98 <ulink url="http://www.fastio.com/">ClibPDF</ulink>,
99 <ulink url="http://www.boutell.com/gd/">GD</ulink>,
100 <ulink url="http://gd.tuwien.ac.at/visual/ibiblio/libs/graphics/t1lib-5.1.0.tar.gz">
101 t1lib</ulink> and
102 <ulink url="http://partners.adobe.com/asn/acrobat/forms.jsp">FDF Toolkit</ulink></para>
103
104 <bridgehead renderas="sect4">Optional Web Utilities</bridgehead>
105 <para><xref linkend="curl"/>,
106 <xref linkend="html-tidy"/>,
107 <ulink url="http://www.mnogosearch.org/">mnoGoSearch</ulink>,
108 <ulink url="http://www.hyperwave.com/">Hyperwave</ulink>,
109 <ulink url="http://caudium.net/">Caudium</ulink> and
110 <ulink url="http://www.openwddx.org/">WDDX</ulink></para>
111
112 <bridgehead renderas="sect4">Optional Data Management Utilities and Libraries</bridgehead>
113 <para><xref linkend="openldap"/>,
114 <xref linkend="gdbm"/>,
115 <xref linkend="db"/>,
116 <xref linkend="mysql"/>,
117 <xref linkend="postgresql"/>,
118 <xref linkend="unixodbc"/>,
119 <ulink url="http://qdbm.sourceforge.net/">QDBM</ulink>,
120 <ulink url="http://cr.yp.to/cdb.html">cdb</ulink>,
121 <ulink url="http://www.sqlite.org/">SQLite</ulink>,
122 <ulink url="http://www.hughes.com.au/products/msql/">Mini SQL</ulink>,
123 <ulink url="http://www.empress.com/">Empress</ulink>,
124 <ulink url="http://www.birdstep.com/">Birdstep</ulink>,
125 <ulink url="http://www.dbmaker.com/">DBMaker</ulink>,
126 <ulink url="http://www.softwareag.com/">Adabas</ulink>,
127 <ulink url="http://www.frontbase.com/">FrontBase</ulink> and
128 <ulink url="http://www.mainstreetsoftworks.com/">Monetra</ulink></para>
129
130 <bridgehead renderas="sect4">Optional Security/Encryption Utilities and Libraries</bridgehead>
131 <para><xref linkend="openssl"/>,
132 <xref linkend="cyrus-sasl"/>,
133 <xref linkend="mitkrb"/> or <xref linkend="heimdal"/>,
134 <ulink url="http://mcrypt.sourceforge.net/">libmcrypt</ulink> and
135 <ulink url="http://mhash.sourceforge.net/">mhash</ulink></para>
136
137 </sect2>
138
139 <sect2 role="installation">
140 <title>Installation of PHP</title>
141
142 <note>
143 <para>You can use <application>PHP</application>
144 for server-side scripting, command line scripting or client-side
145 GUI applications. The book provides instructions for
146 setting up <application>PHP</application> for
147 server-side scripting as it is the most common form.</para>
148 </note>
149
150 <para>If you have <application>Berkeley DB</application> installed and
151 wish to utilize it, apply the following patch:</para>
152
153<screen><userinput>patch -Np1 -i ../php-&php-version;-db43-1.patch</userinput></screen>
154
155 <note>
156 <para><application>PHP</application> has many more
157 <command>configure</command> options that will enable support for certain
158 things. You can use <command>./configure --help</command> to see a full
159 list of the available options. Also, use of the
160 <ulink url="http://www.php.net/">PHP web site</ulink>
161 is highly recommended, as their online docs are very good.</para>
162 </note>
163
164 <para>Remove the <parameter>--disable-libxml</parameter> switch if you
165 have <xref linkend="libxml2"/> installed otherwise
166 <command>pear</command> will not be built.</para>
167
168 <para>Install <application>PHP</application> by
169 running the following commands:</para>
170
171<screen><userinput>./configure --prefix=/usr \
172 --sysconfdir=/etc \
173 --with-apxs2 \
174 --with-config-file-path=/etc \
175 --with-zlib \
176 --enable-bcmath \
177 --with-bz2 \
178 --enable-calendar \
179 --enable-dba \
180 --enable-exif \
181 --enable-ftp \
182 --with-gettext \
183 --enable-mbstring \
184 --with-ncurses \
185 --with-readline \
186 --disable-libxml &amp;&amp;
187make</userinput></screen>
188
189 <para>To test the results, issue: <command>make test</command>. Note that
190 many of the tests are known to fail.</para>
191
192 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
193
194<screen role="root"><userinput>make install &amp;&amp;
195cp -v php.ini-recommended /etc/php.ini</userinput></screen>
196
197 <para>The pre-built HTML documentation is packaged in two forms: a tarball
198 containing many individual files, useful for quick loading into your
199 browser, and a tarball of one large file, which is useful for using the
200 search utility of your browser. If you downloaded any of the documentation,
201 the instructions below can be issued by the
202 <systemitem class='username'>root</systemitem> user to install it (note
203 these instructions assume English docs, modify the tarball names below if
204 necessary).</para>
205
206 <para>For the <quote>Single HTML</quote> tarball:</para>
207
208<screen role="root"><userinput>install -v -m644 ../php_manual_en.html.gz \
209 /usr/share/doc/php-&php-version; &amp;&amp;
210gunzip -v /usr/share/doc/php-&php-version;/php_manual_en.html.gz</userinput></screen>
211
212 <para>For the <quote>Many HTML files</quote> tarball:</para>
213
214<screen role="root"><userinput>install -v -m755 -d /usr/share/doc/php-&php-version; &amp;&amp;
215tar -xvf ../php_manual_en.tar.gz -C /usr/share/doc/php-&php-version; &amp;&amp;
216chown -v -R root:root /usr/share/doc/php-&php-version;/html</userinput></screen>
217
218 </sect2>
219
220 <sect2 role="commands">
221 <title>Command Explanations</title>
222
223 <para><parameter>--with-apxs2</parameter>: This parameter
224 builds the Apache HTTPD 2.0 module.</para>
225
226 <para><parameter>--with-config-file-path=/etc</parameter>: This parameter
227 puts the <filename>php.ini</filename> configuration file in <filename
228 class='directory'>/etc</filename>.</para>
229
230 <para><parameter>--with-zlib</parameter>: This parameter adds
231 support for <application>Zlib</application> compression.</para>
232
233 <para><parameter>--enable-bcmath</parameter>: Enables
234 <command>bc</command> style precision math functions.</para>
235
236 <para><parameter>--with-bz2</parameter>: Adds support for
237 <application>Bzip2</application> compression functions.</para>
238
239 <para><parameter>--enable-calendar</parameter>: This parameter
240 provides support for calendar conversion.</para>
241
242 <para><parameter>--enable-dba</parameter>: This parameter enables
243 support for database (dbm-style) abstraction layer functions.</para>
244
245 <para><parameter>--enable-exif</parameter>: Enables functions
246 to access metadata from images.</para>
247
248 <para><parameter>--enable-ftp</parameter>: This parameter
249 enables FTP functions.</para>
250
251 <para><parameter>--with-gettext</parameter>: Enables functions
252 that use <application>Gettext</application> text translation.</para>
253
254 <para><parameter>--enable-mbstring</parameter>: This parameter
255 enables multibyte string support.</para>
256
257 <para><parameter>--with-ncurses</parameter>: Provides ncurses
258 terminal independent cursor handling.</para>
259
260 <para><parameter>--with-readline</parameter>: This parameter
261 enables command line <application>Readline</application> support.</para>
262
263 <para><parameter>--disable-libxml</parameter>: This parameter
264 allows building PHP without <application>Libxml2</application>
265 installed.</para>
266
267 </sect2>
268
269 <sect2 role="configuration">
270 <title>Configuring PHP</title>
271
272 <sect3 id="php-config">
273 <title>Config Files</title>
274
275 <para><filename>/etc/php.ini</filename>,
276 <filename>/etc/pear.conf</filename></para>
277
278 <indexterm zone="php php-config">
279 <primary sortas="e-etc-php.ini">/etc/php.ini</primary>
280 </indexterm>
281
282 <indexterm zone="php php-config">
283 <primary sortas="e-etc-pear.conf">/etc/pear.conf</primary>
284 </indexterm>
285
286 </sect3>
287
288 <sect3>
289 <title>Configuration Information</title>
290
291 <para>You may have noticed the following from the output of the
292 <command>make install</command> command:</para>
293
294<screen><computeroutput>You may want to add: /usr/lib/php to your php.ini include_path</computeroutput></screen>
295
296 <para>If desired, add the entry using the following command as the
297 <systemitem class="username">root</systemitem> user:</para>
298
299<screen role="root"><userinput>sed -i 's@php/includes"@&amp;\ninclude_path = ".:/usr/lib/php"@' \
300 /etc/php.ini</userinput></screen>
301
302 <para>To enable PHP support in the <application>Apache</application>
303 web server, a new LoadModule (which should be handled automatically by the
304 <command>make install</command> command) and AddType directives
305 must be added to the <filename>httpd.conf</filename> file:</para>
306
307<screen><literal>LoadModule php5_module lib/apache/libphp5.so
308AddType application/x-httpd-php .php</literal></screen>
309
310 <para>Also, it can be useful to add an entry for
311 <filename>index.php</filename> to the DirectoryIndex directive of the
312 <filename>httpd.conf</filename> file.</para>
313
314 <para>You'll need to restart the <application>Apache</application> web server
315 after making any modifications to the <filename>httpd.conf</filename>
316 file.</para>
317
318 </sect3>
319
320 </sect2>
321
322 <sect2 role="content">
323 <title>Contents</title>
324
325 <segmentedlist>
326 <segtitle>Installed Programs</segtitle>
327 <segtitle>Installed Library</segtitle>
328 <segtitle>Installed Directories</segtitle>
329
330 <seglistitem>
331 <seg>pear, php, php-config, phpextdist, and phpize</seg>
332 <seg>libphp5.so</seg>
333 <seg>/usr/include/php and /usr/lib/php</seg>
334 </seglistitem>
335 </segmentedlist>
336
337 <variablelist>
338 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
339 <?dbfo list-presentation="list"?>
340 <?dbhtml list-presentation="table"?>
341
342 <varlistentry id="php-prog">
343 <term><command>php</command></term>
344 <listitem>
345 <para>is a command line interface that enables you to parse and
346 execute PHP code.</para>
347 <indexterm zone="php php-prog">
348 <primary sortas="b-php">php</primary>
349 </indexterm>
350 </listitem>
351 </varlistentry>
352
353 <varlistentry id="pear">
354 <term><command>pear</command></term>
355 <listitem>
356 <para>is the PHP Extension and Application
357 Repository (PEAR) package manager.</para>
358 <indexterm zone="php pear">
359 <primary sortas="b-pear">pear</primary>
360 </indexterm>
361 </listitem>
362 </varlistentry>
363
364 </variablelist>
365
366 </sect2>
367
368</sect1>
Note: See TracBrowser for help on using the repository browser.