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 "fb1aac107870f897d26563a9cc5053c0">
|
---|
10 | <!ENTITY php-size "4.7 MB">
|
---|
11 | <!ENTITY php-buildsize "138 MB">
|
---|
12 | <!ENTITY php-time "1.9 SBU">
|
---|
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><xref linkend="apache"/></para>
|
---|
74 |
|
---|
75 | <bridgehead renderas="sect4">Optional System Utilities and Libraries</bridgehead>
|
---|
76 | <para><xref linkend="libxml2"/>,
|
---|
77 | <xref linkend="libxslt"/>,
|
---|
78 | <xref linkend="gamin"/>,
|
---|
79 | <xref linkend="gmp"/>,
|
---|
80 | <xref linkend="pcre"/>,
|
---|
81 | <xref linkend="aspell"/>,
|
---|
82 | <xref linkend="pkgconfig"/>,
|
---|
83 | <xref linkend="expat"/>,
|
---|
84 | <ulink url="http://www.ossp.org/pkg/lib/mm/">OSSP mm</ulink>,
|
---|
85 | <ulink url="http://www.net-snmp.org/">Net-SNMP</ulink>,
|
---|
86 | <ulink url="http://dmalloc.com/">Dmalloc</ulink>,
|
---|
87 | <ulink url="http://www.gnu.org/software/recode/">recode</ulink> and
|
---|
88 | an <ulink url="../server/mail.html">MTA</ulink></para>
|
---|
89 |
|
---|
90 | <bridgehead renderas="sect4">Optional Graphics Utilities and Libraries</bridgehead>
|
---|
91 | <para><xref linkend="libjpeg"/>,
|
---|
92 | <xref linkend="libtiff"/>,
|
---|
93 | <xref linkend="libpng"/>,
|
---|
94 | <xref linkend="freetype2"/>,
|
---|
95 | X (<xref linkend="xorg"/> or <xref linkend="xfree86"/>),
|
---|
96 | <ulink url="http://www.fastio.com/">ClibPDF</ulink>,
|
---|
97 | <ulink url="http://www.boutell.com/gd/">GD</ulink>,
|
---|
98 | <ulink url="http://gd.tuwien.ac.at/visual/ibiblio/libs/graphics/t1lib-5.1.0.tar.gz">
|
---|
99 | t1lib</ulink> and
|
---|
100 | <ulink url="http://partners.adobe.com/asn/acrobat/forms.jsp">FDF Toolkit</ulink></para>
|
---|
101 |
|
---|
102 | <bridgehead renderas="sect4">Optional Web Utilities</bridgehead>
|
---|
103 | <para><xref linkend="curl"/>,
|
---|
104 | <xref linkend="html-tidy"/>,
|
---|
105 | <ulink url="http://www.mnogosearch.org/">mnoGoSearch</ulink>,
|
---|
106 | <ulink url="http://www.hyperwave.com/">Hyperwave</ulink>,
|
---|
107 | <ulink url="http://caudium.net/">Caudium</ulink> and
|
---|
108 | <ulink url="http://www.openwddx.org/">WDDX</ulink></para>
|
---|
109 |
|
---|
110 | <bridgehead renderas="sect4">Optional Data Management Utilities and Libraries</bridgehead>
|
---|
111 | <para><xref linkend="openldap"/>,
|
---|
112 | <xref linkend="gdbm"/>,
|
---|
113 | <xref linkend="db"/>,
|
---|
114 | <xref linkend="mysql"/>,
|
---|
115 | <xref linkend="postgresql"/>,
|
---|
116 | <xref linkend="unixodbc"/>,
|
---|
117 | <ulink url="http://qdbm.sourceforge.net/">QDBM</ulink>,
|
---|
118 | <ulink url="http://cr.yp.to/cdb.html">cdb</ulink>,
|
---|
119 | <ulink url="http://www.sqlite.org/">SQLite</ulink>,
|
---|
120 | <ulink url="http://www.hughes.com.au/products/msql/">Mini SQL</ulink>,
|
---|
121 | <ulink url="http://www.empress.com/">Empress</ulink>,
|
---|
122 | <ulink url="http://www.birdstep.com/">Birdstep</ulink>,
|
---|
123 | <ulink url="http://www.dbmaker.com/">DBMaker</ulink>,
|
---|
124 | <ulink url="http://www.softwareag.com/">Adabas</ulink>,
|
---|
125 | <ulink url="http://www.frontbase.com/">FrontBase</ulink> and
|
---|
126 | <ulink url="http://www.mainstreetsoftworks.com/">Monetra</ulink></para>
|
---|
127 |
|
---|
128 | <bridgehead renderas="sect4">Optional Security/Encryption Utilities and Libraries</bridgehead>
|
---|
129 | <para><xref linkend="openssl"/>,
|
---|
130 | <xref linkend="cyrus-sasl"/>,
|
---|
131 | <xref linkend="mitkrb"/> or <xref linkend="heimdal"/>,
|
---|
132 | <ulink url="http://mcrypt.sourceforge.net/">libmcrypt</ulink> and
|
---|
133 | <ulink url="http://mhash.sourceforge.net/">mhash</ulink></para>
|
---|
134 |
|
---|
135 | </sect2>
|
---|
136 |
|
---|
137 | <sect2 role="installation">
|
---|
138 | <title>Installation of PHP</title>
|
---|
139 |
|
---|
140 | <note>
|
---|
141 | <para>You can use <application>PHP</application>
|
---|
142 | for server-side scripting, command line scripting or client-side
|
---|
143 | GUI applications. The book provides instructions for
|
---|
144 | setting up <application>PHP</application> for
|
---|
145 | server-side scripting as it is the most common form.</para>
|
---|
146 | </note>
|
---|
147 |
|
---|
148 | <para>If you have <application>Berkeley DB</application> installed and
|
---|
149 | wish to utilize it, apply the following patch:</para>
|
---|
150 |
|
---|
151 | <screen><userinput>patch -Np1 -i ../php-&php-version;-db43-1.patch</userinput></screen>
|
---|
152 |
|
---|
153 | <note>
|
---|
154 | <para><application>PHP</application> has many more
|
---|
155 | <command>configure</command> options that will enable support for certain
|
---|
156 | things. You can use <command>./configure --help</command> to see a full
|
---|
157 | list of the available options. Also, use of the
|
---|
158 | <ulink url="http://www.php.net/">PHP web site</ulink>
|
---|
159 | is highly recommended, as their online docs are very good.</para>
|
---|
160 | </note>
|
---|
161 |
|
---|
162 | <para>Remove the <option>--disable-libxml</option> switch if you
|
---|
163 | have <xref linkend="libxml2"/> installed otherwise
|
---|
164 | <command>pear</command> will not be built.</para>
|
---|
165 |
|
---|
166 | <para>Install <application>PHP</application> by
|
---|
167 | running the following commands:</para>
|
---|
168 |
|
---|
169 | <screen><userinput>./configure --prefix=/usr \
|
---|
170 | --sysconfdir=/etc \
|
---|
171 | --with-apxs2 \
|
---|
172 | --with-config-file-path=/etc \
|
---|
173 | --with-zlib \
|
---|
174 | --enable-bcmath \
|
---|
175 | --with-bz2 \
|
---|
176 | --enable-calendar \
|
---|
177 | --enable-dba \
|
---|
178 | --enable-exif \
|
---|
179 | --enable-ftp \
|
---|
180 | --with-gettext \
|
---|
181 | --enable-mbstring \
|
---|
182 | --with-ncurses \
|
---|
183 | --with-readline \
|
---|
184 | --disable-libxml &&
|
---|
185 | make</userinput></screen>
|
---|
186 |
|
---|
187 | <para>To test the results, issue: <command>make test</command>. Note that
|
---|
188 | many of the tests are known to fail.</para>
|
---|
189 |
|
---|
190 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
191 |
|
---|
192 | <screen role="root"><userinput>make install &&
|
---|
193 | cp -v php.ini-recommended /etc/php.ini</userinput></screen>
|
---|
194 |
|
---|
195 | <para>The pre-built HTML documentation is packaged in two forms: a tarball
|
---|
196 | containing many individual files, useful for quick loading into your
|
---|
197 | browser, and a tarball of one large file, which is useful for using the
|
---|
198 | search utility of your browser. If you downloaded any of the documentation,
|
---|
199 | the instructions below can be issued by the
|
---|
200 | <systemitem class='username'>root</systemitem> user to install it (note
|
---|
201 | these instructions assume English docs, modify the tarball names below if
|
---|
202 | necessary).</para>
|
---|
203 |
|
---|
204 | <para>For the <quote>Single HTML</quote> tarball:</para>
|
---|
205 |
|
---|
206 | <screen role="root"><userinput>install -v -m644 ../php_manual_en.html.gz \
|
---|
207 | /usr/share/doc/php-&php-version; &&
|
---|
208 | gunzip -v /usr/share/doc/php-&php-version;/php_manual_en.html.gz</userinput></screen>
|
---|
209 |
|
---|
210 | <para>For the <quote>Many HTML files</quote> tarball:</para>
|
---|
211 |
|
---|
212 | <screen role="root"><userinput>install -v -m755 -d /usr/share/doc/php-&php-version; &&
|
---|
213 | tar -xvf ../php_manual_en.tar.gz -C /usr/share/doc/php-&php-version; &&
|
---|
214 | chown -v -R root:root /usr/share/doc/php-&php-version;/html</userinput></screen>
|
---|
215 |
|
---|
216 | </sect2>
|
---|
217 |
|
---|
218 | <sect2 role="commands">
|
---|
219 | <title>Command Explanations</title>
|
---|
220 |
|
---|
221 | <para><parameter>--with-apxs2</parameter>: This parameter
|
---|
222 | builds the Apache HTTPD 2.0 module.</para>
|
---|
223 |
|
---|
224 | <para><parameter>--with-config-file-path=/etc</parameter>: This parameter
|
---|
225 | puts the <filename>php.ini</filename> configuration file in <filename
|
---|
226 | class='directory'>/etc</filename>.</para>
|
---|
227 |
|
---|
228 | <para><parameter>--with-zlib</parameter>: This parameter adds
|
---|
229 | support for <application>Zlib</application> compression.</para>
|
---|
230 |
|
---|
231 | <para><parameter>--enable-bcmath</parameter>: Enables
|
---|
232 | <command>bc</command> style precision math functions.</para>
|
---|
233 |
|
---|
234 | <para><parameter>--with-bz2</parameter>: Add support for
|
---|
235 | <application>Bzip2</application> compression functions.</para>
|
---|
236 |
|
---|
237 | <para><parameter>--enable-calendar</parameter>: This parameter
|
---|
238 | provides support for calendar conversion.</para>
|
---|
239 |
|
---|
240 | <para><parameter>--enable-dba</parameter>: This parameter enables
|
---|
241 | numerous database support including Berkeley DB functions.</para>
|
---|
242 |
|
---|
243 | <para><parameter>--enable-exif</parameter>: Enables functions
|
---|
244 | to access metadata from images.</para>
|
---|
245 |
|
---|
246 | <para><parameter>--enable-ftp</parameter>: This parameter
|
---|
247 | enables FTP functions.</para>
|
---|
248 |
|
---|
249 | <para><parameter>--with-gettext</parameter>: Enables functions
|
---|
250 | that use <application>Gettext</application> text translation.</para>
|
---|
251 |
|
---|
252 | <para><parameter>--enable-mbstring</parameter>: This parameter
|
---|
253 | enables multibyte string support.</para>
|
---|
254 |
|
---|
255 | <para><parameter>--with-ncurses</parameter>: Provides ncurses
|
---|
256 | terminal independent cursor handling.</para>
|
---|
257 |
|
---|
258 | <para><parameter>--with-readline</parameter>: This parameter
|
---|
259 | enables command line <application>Readline</application> support.</para>
|
---|
260 |
|
---|
261 | <para><parameter>--disable-libxml</parameter>: This parameter
|
---|
262 | disables XML support functions. This should be removed if you have
|
---|
263 | <application>Libxml2</application> installed.</para>
|
---|
264 |
|
---|
265 | </sect2>
|
---|
266 |
|
---|
267 | <sect2 role="configuration">
|
---|
268 | <title>Configuring PHP</title>
|
---|
269 |
|
---|
270 | <sect3 id="php-config">
|
---|
271 | <title>Config Files</title>
|
---|
272 |
|
---|
273 | <para><filename>/etc/php.ini</filename>,
|
---|
274 | <filename>/etc/pear.conf</filename></para>
|
---|
275 |
|
---|
276 | <indexterm zone="php php-config">
|
---|
277 | <primary sortas="e-etc-php.ini">/etc/php.ini</primary>
|
---|
278 | </indexterm>
|
---|
279 |
|
---|
280 | <indexterm zone="php php-config">
|
---|
281 | <primary sortas="e-etc-pear.conf">/etc/pear.conf</primary>
|
---|
282 | </indexterm>
|
---|
283 |
|
---|
284 | </sect3>
|
---|
285 |
|
---|
286 | <sect3>
|
---|
287 | <title>Configuration Information</title>
|
---|
288 |
|
---|
289 | <para>You may have noticed the following from the output of the
|
---|
290 | <command>make install</command> command:</para>
|
---|
291 |
|
---|
292 | <screen><computeroutput>You may want to add: /usr/lib/php to your php.ini include_path</computeroutput></screen>
|
---|
293 |
|
---|
294 | <para>If desired, add the entry using the following command as the
|
---|
295 | <systemitem class="username">root</systemitem> user:</para>
|
---|
296 |
|
---|
297 | <screen role="root"><userinput>sed -i 's@php/includes"@&\ninclude_path = ".:/usr/lib/php"@' \
|
---|
298 | /etc/php.ini</userinput></screen>
|
---|
299 |
|
---|
300 | <para>To enable PHP support in the <application>Apache</application>
|
---|
301 | web server, a new LoadModule (which should be handled automatically by the
|
---|
302 | <command>make install</command> command) and AddType directives
|
---|
303 | must be added to the <filename>httpd.conf</filename> file:</para>
|
---|
304 |
|
---|
305 | <screen><literal>LoadModule php5_module lib/apache/libphp5.so
|
---|
306 | AddType application/x-httpd-php .php</literal></screen>
|
---|
307 |
|
---|
308 | <para>Also, it can be useful to add an entry for
|
---|
309 | <filename>index.php</filename> to the DirectoryIndex directive of the
|
---|
310 | <filename>httpd.conf</filename> file.</para>
|
---|
311 |
|
---|
312 | <para>You'll need to restart the <application>Apache</application> web server
|
---|
313 | after making any modifications to the <filename>httpd.conf</filename>
|
---|
314 | file.</para>
|
---|
315 |
|
---|
316 | </sect3>
|
---|
317 |
|
---|
318 | </sect2>
|
---|
319 |
|
---|
320 | <sect2 role="content">
|
---|
321 | <title>Contents</title>
|
---|
322 |
|
---|
323 | <segmentedlist>
|
---|
324 | <segtitle>Installed Programs</segtitle>
|
---|
325 | <segtitle>Installed Library</segtitle>
|
---|
326 | <segtitle>Installed Directories</segtitle>
|
---|
327 |
|
---|
328 | <seglistitem>
|
---|
329 | <seg>pear, php, php-config, phpextdist, and phpize</seg>
|
---|
330 | <seg>libphp5.so</seg>
|
---|
331 | <seg>/usr/include/php and /usr/lib/php</seg>
|
---|
332 | </seglistitem>
|
---|
333 | </segmentedlist>
|
---|
334 |
|
---|
335 | <variablelist>
|
---|
336 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
337 | <?dbfo list-presentation="list"?>
|
---|
338 | <?dbhtml list-presentation="table"?>
|
---|
339 |
|
---|
340 | <varlistentry id="php-prog">
|
---|
341 | <term><command>php</command></term>
|
---|
342 | <listitem>
|
---|
343 | <para>is a command line interface that enables you to parse and
|
---|
344 | execute PHP code.</para>
|
---|
345 | <indexterm zone="php php-prog">
|
---|
346 | <primary sortas="b-php">php</primary>
|
---|
347 | </indexterm>
|
---|
348 | </listitem>
|
---|
349 | </varlistentry>
|
---|
350 |
|
---|
351 | <varlistentry id="pear">
|
---|
352 | <term><command>pear</command></term>
|
---|
353 | <listitem>
|
---|
354 | <para>is the PHP Extension and Application
|
---|
355 | Repository (PEAR) package manager.</para>
|
---|
356 | <indexterm zone="php pear">
|
---|
357 | <primary sortas="b-pear">pear</primary>
|
---|
358 | </indexterm>
|
---|
359 | </listitem>
|
---|
360 | </varlistentry>
|
---|
361 |
|
---|
362 | </variablelist>
|
---|
363 |
|
---|
364 | </sect2>
|
---|
365 |
|
---|
366 | </sect1>
|
---|