source: general/prog/php.xml@ 4a39deed

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 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 4a39deed was 4a39deed, checked in by Pierre Labastie <pieere@…>, 10 years ago

Typos

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

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