source: general/prog/php.xml@ 3b10fa8

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 3b10fa8 was 4d61f73, checked in by Bruce Dubbs <bdubbs@…>, 13 years ago

php tweaks

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

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