source: general/prog/php.xml@ 2f7d86f

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 2f7d86f was 256ee72c, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Adding automatized scripts generation related tags. Prog chapter.

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

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