source: general/prog/php.xml@ 13a9e84e

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 13a9e84e was 13a9e84e, checked in by Bruce Dubbs <bdubbs@…>, 11 years ago

Update to php-5.5.2.
Tag apache, mysql.

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

  • Property mode set to 100644
File size: 15.6 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/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 "caf7f4d86514a568fb3c8021b096a9f0">
10 <!ENTITY php-size "11.7 MB">
11 <!ENTITY php-buildsize "356 MB">
12 <!ENTITY php-time "2.4 SBU (additional 2.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. It is also useful as a
35 general purpose scripting language.</para>
36
37 &lfs74_checked;
38
39 <bridgehead renderas="sect3">Package Information</bridgehead>
40 <itemizedlist spacing="compact">
41 <listitem>
42 <para>Download (HTTP): <ulink url="&php-download-http;"/></para>
43 </listitem>
44 <listitem>
45 <para>Download (FTP): <ulink url="&php-download-ftp;"/></para>
46 </listitem>
47 <listitem>
48 <para>Download MD5 sum: &php-md5sum;</para>
49 </listitem>
50 <listitem>
51 <para>Download size: &php-size;</para>
52 </listitem>
53 <listitem>
54 <para>Estimated disk space required: &php-buildsize;</para>
55 </listitem>
56 <listitem>
57 <para>Estimated build time: &php-time;</para>
58 </listitem>
59 </itemizedlist>
60
61 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
62 <itemizedlist spacing="compact">
63 <listitem>
64 <para>Pre-built documentation (optional): <ulink
65 url="http://www.php.net/download-docs.php"/></para>
66 </listitem>
67 </itemizedlist>
68
69 <bridgehead renderas="sect3">PHP Dependencies</bridgehead>
70
71 <bridgehead renderas="sect4">Required</bridgehead>
72 <para role="required"><xref linkend="apache"/></para>
73
74 <bridgehead renderas="sect4">Recommended</bridgehead>
75 <para role="recommended"><xref linkend="libxml2"/></para>
76
77 <bridgehead renderas="sect4">Optional System Utilities and Libraries</bridgehead>
78 <para role="optional"><xref linkend="libxslt"/>,
79 <!-- <xref linkend="gamin"/>, -->
80 <xref linkend="pcre"/>,
81 <xref linkend="aspell"/>,
82 <xref linkend="enchant"/>,
83 <xref linkend="pkgconfig"/>,
84 <!-- <xref linkend="recode"/>, -->
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 <xref linkend="pth"/>,
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>, and
92 an <xref linkend="server-mail"/> (that provides a
93 <command>sendmail</command> command)</para>
94
95 <bridgehead renderas="sect4">Optional Graphics Utilities and Libraries</bridgehead>
96 <para role="optional"><xref linkend="libjpeg"/>,
97 <xref linkend="libtiff"/>,
98 <xref linkend="libpng"/>,
99 <xref linkend="libexif"/>,
100 <xref linkend="freetype2"/>,
101 <xref linkend="x-window-system"/>,
102 <ulink url="http://www.fastio.com/">ClibPDF</ulink>,
103 <ulink url="http://fossies.org/unix/www/gd-2.0.35.tar.gz/">GD (has bugs)</ulink>,
104 <ulink url="http://www.sfr-fresh.com/linux/misc/t1lib">t1lib</ulink>, and
105 <ulink url="http://partners.adobe.com/asn/acrobat/forms.jsp">FDF Toolkit</ulink></para>
106
107 <bridgehead renderas="sect4">Optional Web Utilities</bridgehead>
108 <para role="optional"><xref linkend="curl"/>,
109 <xref linkend="html-tidy"/>,
110 <ulink url="http://www.mnogosearch.org/">mnoGoSearch</ulink>,
111 <ulink url="http://www.hyperwave.com/">Hyperwave</ulink>,
112 <ulink url="http://www.roxen.com/products/webserver/">Roxen WebServer</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 <xref linkend="sqlite"/>,
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.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 <para><application>PHP</application> also provides support for many
135 commercial database tools such as <application>Oracle</application>,
136 <application>SAP</application> and
137 <application>ODBC Router</application>.</para>
138
139 <bridgehead renderas="sect4">Optional Security/Encryption Utilities and Libraries</bridgehead>
140 <para role="optional"><xref linkend="openssl"/>,
141 <xref linkend="cyrus-sasl"/>,
142 <xref linkend="mitkrb"/>,
143 <ulink url="http://mcrypt.sourceforge.net/">libmcrypt</ulink>, and
144 <ulink url="http://mhash.sourceforge.net/">mhash</ulink></para>
145
146 <para condition="html" role="usernotes">User Notes:
147 <ulink url="&blfs-wiki;/php"/></para>
148
149 </sect2>
150
151 <sect2 role="installation">
152 <title>Installation of PHP</title>
153
154 <para>You can use <application>PHP</application> for server-side
155 scripting, command-line scripting or client-side GUI applications. This
156 book provides instructions for setting up <application>PHP</application>
157 for server-side scripting as it is the most common form.</para>
158
159 <note>
160 <para><application>PHP</application> has many more
161 <command>configure</command> options that will enable support for various
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. An example of
166 a <command>configure</command> command that utilizes many of the most
167 common dependencies can be found at <ulink
168 url="&files-anduin;/php_configure.txt"/>.
169 </para>
170
171 <para>If, for whatever reason, you don't have <xref linkend="libxml2"/>
172 installed, you need to add <option>--disable-libxml</option> to the
173 <command>configure</command> command in the instructions below. Note that
174 this will prevent the <command>pear</command> command from being
175 built.</para>
176 </note>
177
178 <para>Install <application>PHP</application> by
179 running the following commands:</para>
180
181<screen><userinput>./configure --prefix=/usr \
182 --sysconfdir=/etc \
183 --with-apxs2 \
184 --with-config-file-path=/etc \
185 --with-zlib \
186 --enable-bcmath \
187 --with-bz2 \
188 --enable-calendar \
189 --enable-dba=shared \
190 --with-gdbm \
191 --with-gmp \
192 --enable-ftp \
193 --with-gettext \
194 --enable-mbstring \
195 --with-readline &amp;&amp;
196make</userinput></screen>
197
198 <para>To test the results, issue: <command>make test</command>. A few
199 tests may fail.</para>
200
201 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
202
203<screen role="root"><userinput>make install &amp;&amp;
204install -v -m644 php.ini-production /etc/php.ini &amp;&amp;
205
206install -v -m755 -d /usr/share/doc/php-&php-version; &amp;&amp;
207install -v -m644 CODING_STANDARDS EXTENSIONS INSTALL NEWS README* UPGRADING* php.gif \
208 /usr/share/doc/php-&php-version; &amp;&amp;
209ln -v -sfn /usr/lib/php/doc/Archive_Tar/docs/Archive_Tar.txt \
210 /usr/share/doc/php-&php-version; &amp;&amp;
211ln -v -sfn /usr/lib/php/doc/Structures_Graph/docs \
212 /usr/share/doc/php-&php-version;</userinput></screen>
213
214 <para>The pre-built HTML documentation is packaged in two forms: a tarball
215 containing many individual files, useful for quick loading into your
216 browser, and one large individual file, which is useful for using the
217 search utility of your browser. If you downloaded either, or both, of the
218 documentation files, issue the following commands as the
219 <systemitem class='username'>root</systemitem> user to install them (note
220 these instructions assume English docs, modify the tarball names below if
221 necessary).</para>
222
223 <para>For the <quote>Single HTML</quote> file:</para>
224
225<screen role="root"><userinput>install -v -m644 ../php_manual_en.html.gz \
226 /usr/share/doc/php-&php-version; &amp;&amp;
227gunzip -v /usr/share/doc/php-&php-version;/php_manual_en.html.gz</userinput></screen>
228
229 <para>For the <quote>Many HTML files</quote> tarball:</para>
230
231<screen role="root"><userinput>tar -xvf ../php_manual_en.tar.gz \
232 -C /usr/share/doc/php-&php-version; --no-same-owner</userinput></screen>
233
234 </sect2>
235
236 <sect2 role="commands">
237 <title>Command Explanations</title>
238
239 <para><parameter>--with-apxs2</parameter>: This parameter
240 builds the Apache HTTPD 2.0 module.</para>
241
242 <para><parameter>--with-config-file-path=/etc</parameter>: This parameter
243 makes <application>PHP</application> look for the
244 <filename>php.ini</filename> configuration file in
245 <filename class='directory'>/etc</filename>.</para>
246
247 <para><parameter>--with-zlib</parameter>: This parameter adds
248 support for <application>Zlib</application> compression.</para>
249
250 <para><parameter>--enable-bcmath</parameter>: Enables
251 <command>bc</command> style precision math functions.</para>
252
253 <para><parameter>--with-bz2</parameter>: Adds support for
254 <application>Bzip2</application> compression functions.</para>
255
256 <para><parameter>--enable-calendar</parameter>: This parameter
257 provides support for calendar conversion.</para>
258
259 <para><parameter>--enable-dba=shared</parameter>: This parameter enables
260 support for database (dbm-style) abstraction layer functions.</para>
261
262 <para><parameter>--enable-ftp</parameter>: This parameter
263 enables FTP functions.</para>
264
265 <para><parameter>--with-gettext</parameter>: Enables functions
266 that use <application>Gettext</application> text translation.</para>
267
268 <para><parameter>--enable-mbstring</parameter>: This parameter
269 enables multibyte string support.</para>
270
271 <para><parameter>--with-readline</parameter>: This parameter
272 enables command line <application>Readline</application> support.</para>
273
274 <para><option>--disable-libxml</option>: This option
275 allows building PHP without <application>libxml2</application>
276 installed.</para>
277
278 </sect2>
279
280 <sect2 role="configuration">
281 <title>Configuring PHP</title>
282
283 <sect3 id="php-config">
284 <title>Config Files</title>
285
286 <para><filename>/etc/php.ini</filename> and
287 <filename>/etc/pear.conf</filename></para>
288
289 <indexterm zone="php php-config">
290 <primary sortas="e-etc-php.ini">/etc/php.ini</primary>
291 </indexterm>
292
293 <indexterm zone="php php-config">
294 <primary sortas="e-etc-pear.conf">/etc/pear.conf</primary>
295 </indexterm>
296
297 </sect3>
298
299 <sect3>
300 <title>Configuration Information</title>
301
302 <para>The file used as the default <filename>/etc/php.ini</filename>
303 configuration file is recommended by the <application>PHP</application>
304 development team. This file modifies the default behavior of
305 <application>PHP</application>. If no <filename>/etc/php.ini</filename>
306 is used, all configuration settings fall to the defaults. You should
307 review the comments in this file and ensure the changes are acceptable
308 in your particular environment.</para>
309
310 <para>You may have noticed the following from the output of the
311 <command>make install</command> command:</para>
312
313<screen><computeroutput>You may want to add: /usr/lib/php to your php.ini include_path</computeroutput></screen>
314
315 <para>If desired, add the entry using the following command as the
316 <systemitem class="username">root</systemitem> user:</para>
317
318<screen role="root"><userinput>sed -i 's@php/includes"@&amp;\ninclude_path = ".:/usr/lib/php"@' \
319 /etc/php.ini</userinput></screen>
320
321 <para>To enable PHP support in the <application>Apache</application>
322 web server, a new LoadModule (which should be handled automatically by the
323 <command>make install</command> command) and AddType directives
324 must be added to the <filename>httpd.conf</filename> file:</para>
325
326<screen><literal>LoadModule php5_module lib/apache/libphp5.so
327AddType application/x-httpd-php .php</literal></screen>
328
329 <para>Additionally, it can be useful to add an entry for
330 <filename>index.php</filename> to the DirectoryIndex directive of the
331 <filename>httpd.conf</filename> file. Lastly, adding a line to setup the
332 <filename class='extension'>.phps</filename> extension to show
333 highlighted <application>PHP</application> source may be
334 desirable:</para>
335
336<screen><literal>AddType application/x-httpd-php-source .phps</literal></screen>
337
338 <para>You'll need to restart the <application>Apache</application> web server
339 after making any modifications to the <filename>httpd.conf</filename>
340 file.</para>
341
342 </sect3>
343
344 </sect2>
345
346 <sect2 role="content">
347 <title>Contents</title>
348
349 <segmentedlist>
350 <segtitle>Installed Programs</segtitle>
351 <segtitle>Installed Library</segtitle>
352 <segtitle>Installed Directories</segtitle>
353
354 <seglistitem>
355 <seg>pear, peardev, pecl, php, php-config and phpize</seg>
356 <seg>libphp5.so Apache module</seg>
357 <seg>/usr/include/php, /usr/lib/php and
358 /usr/share/doc/php-&php-version;</seg>
359 </seglistitem>
360 </segmentedlist>
361
362 <variablelist>
363 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
364 <?dbfo list-presentation="list"?>
365 <?dbhtml list-presentation="table"?>
366
367 <varlistentry id="php-prog">
368 <term><command>php</command></term>
369 <listitem>
370 <para>is a command line interface that enables you to parse and
371 execute PHP code.</para>
372 <indexterm zone="php php-prog">
373 <primary sortas="b-php">php</primary>
374 </indexterm>
375 </listitem>
376 </varlistentry>
377
378 <varlistentry id="pear">
379 <term><command>pear</command></term>
380 <listitem>
381 <para>is the PHP Extension and Application
382 Repository (PEAR) package manager.</para>
383 <indexterm zone="php pear">
384 <primary sortas="b-pear">pear</primary>
385 </indexterm>
386 </listitem>
387 </varlistentry>
388
389 </variablelist>
390
391 </sect2>
392
393</sect1>
Note: See TracBrowser for help on using the repository browser.