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

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 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 7bff1b2 was 7bff1b2, checked in by Randy McMurchy <randy@…>, 15 years ago

Commented out all unnecessary references to GDBM as it is in LFS now

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

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