source: general/prog/php.xml@ 254be7d3

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 254be7d3 was 254be7d3, checked in by Bruce Dubbs <bdubbs@…>, 18 years ago

Fixed wording in php describing ini file

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

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