[08254fc] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[ff769b8c] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.4/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">
|
---|
[b9d1118] | 9 | <!ENTITY php-md5sum "fb1aac107870f897d26563a9cc5053c0">
|
---|
| 10 | <!ENTITY php-size "4.7 MB">
|
---|
| 11 | <!ENTITY php-buildsize "126 MB">
|
---|
| 12 | <!ENTITY php-time "1.82 SBU">
|
---|
[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">
|
---|
| 60 | <listitem>
|
---|
[7cd76d62] | 61 | <para>Required patch for Berkeley DB: <ulink
|
---|
[db81e4cb] | 62 | url="&patch-root;/php-&php-version;-db43-1.patch"/></para>
|
---|
| 63 | </listitem>
|
---|
| 64 | </itemizedlist>
|
---|
| 65 |
|
---|
| 66 | <bridgehead renderas="sect3">PHP Dependencies</bridgehead>
|
---|
| 67 |
|
---|
| 68 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
| 69 | <para><xref linkend="apache"/></para>
|
---|
| 70 |
|
---|
| 71 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
| 72 | <para><xref linkend="libxml2"/>,
|
---|
| 73 | <xref linkend="libxslt"/>,
|
---|
| 74 | <xref linkend="openssl"/>,
|
---|
| 75 | <ulink url="http://www.fastio.com/">ClibPDF</ulink>,
|
---|
| 76 | <xref linkend="libjpeg"/>,
|
---|
| 77 | <xref linkend="libtiff"/>,
|
---|
| 78 | <xref linkend="curl"/>,
|
---|
| 79 | <ulink url="http://qdbm.sourceforge.net/">QDBM</ulink>,
|
---|
| 80 | <ulink url="http://cr.yp.to/cdb.html">cdb</ulink>,
|
---|
[7cd76d62] | 81 | <xref linkend="gdbm"/>,
|
---|
[db81e4cb] | 82 | <xref linkend="db"/>,
|
---|
| 83 | <xref linkend="fam"/>,
|
---|
| 84 | <ulink url="http://www.boutell.com/gd/">GD</ulink>,
|
---|
| 85 | <xref linkend="libpng"/>,
|
---|
| 86 | X (<xref linkend="xorg"/> or <xref linkend="xfree86"/>),
|
---|
| 87 | <xref linkend="freetype2"/>,
|
---|
[7cd76d62] | 88 | <ulink
|
---|
[da02666] | 89 | url="http://gd.tuwien.ac.at/visual/ibiblio/libs/graphics/t1lib-5.1.0.tar.gz">
|
---|
[db81e4cb] | 90 | t1lib</ulink>,
|
---|
| 91 | <xref linkend="gmp"/>
|
---|
| 92 | <xref linkend="mysql"/>,
|
---|
| 93 | <xref linkend="pcre"/>,
|
---|
| 94 | <xref linkend="postgresql"/>,
|
---|
| 95 | <xref linkend="aspell"/>,
|
---|
| 96 | <xref linkend="pkgconfig"/>,
|
---|
| 97 | <xref linkend="html-tidy"/>,
|
---|
| 98 | <xref linkend="openldap"/>,
|
---|
| 99 | <xref linkend="cyrus-sasl"/>,
|
---|
| 100 | <xref linkend="mitkrb"/> or <xref linkend="heimdal"/>,
|
---|
[da02666] | 101 | <ulink url="http://mcrypt.sourceforge.net/">libmcrypt</ulink>,
|
---|
[db81e4cb] | 102 | <ulink url="http://mhash.sourceforge.net/">mhash</ulink>,
|
---|
[b3799be4] | 103 | <ulink url="http://www.ossp.org/pkg/lib/mm/">OSSP mm</ulink>,
|
---|
[db81e4cb] | 104 | <ulink url="http://www.net-snmp.org/">Net-SNMP</ulink>,
|
---|
| 105 | <ulink url="http://www.sqlite.org/">SQLite</ulink>,
|
---|
| 106 | <ulink url="http://dmalloc.com/">Dmalloc</ulink>,
|
---|
| 107 | <ulink url="http://www.mnogosearch.org/">mnoGoSearch</ulink>,
|
---|
| 108 | <ulink url="http://www.hughes.com.au/products/msql/">Mini SQL</ulink>,
|
---|
| 109 | <ulink url="http://www.empress.com/">Empress</ulink>,
|
---|
| 110 | <ulink url="http://www.birdstep.com/">Birdstep</ulink>,
|
---|
| 111 | <ulink url="http://www.dbmaker.com/">DBMaker</ulink>,
|
---|
| 112 | <ulink url="http://www.softwareag.com/">Adabas</ulink>,
|
---|
| 113 | <ulink url="http://www.frontbase.com/">FrontBase</ulink>,
|
---|
| 114 | <ulink url="http://caudium.net/">Caudium</ulink>,
|
---|
| 115 | <ulink url="http://www.openwddx.org/">WDDX</ulink>,
|
---|
| 116 | <ulink url="http://partners.adobe.com/asn/acrobat/forms.jsp">
|
---|
| 117 | FDF Toolkit</ulink>,
|
---|
| 118 | <ulink url="http://www.hyperwave.com/">Hyperwave</ulink>,
|
---|
| 119 | <ulink url="http://www.mainstreetsoftworks.com/">Monetra</ulink>,
|
---|
| 120 | <xref linkend="expat"/> and
|
---|
| 121 | <ulink url="../server/mail.html">MTA</ulink></para>
|
---|
| 122 |
|
---|
| 123 | </sect2>
|
---|
| 124 |
|
---|
| 125 | <sect2 role="installation">
|
---|
| 126 | <title>Installation of PHP</title>
|
---|
| 127 |
|
---|
| 128 | <note>
|
---|
| 129 | <para>You can use <application>PHP</application>
|
---|
| 130 | for server-side scripting, command line scripting or client-side
|
---|
| 131 | GUI applications. The book provides instructions for
|
---|
| 132 | setting up <application>PHP</application> for
|
---|
| 133 | server-side scripting as it is the most common form.</para>
|
---|
| 134 | </note>
|
---|
| 135 |
|
---|
[7cd76d62] | 136 | <para>If you have <application>Berkeley DB</application> installed and
|
---|
[db81e4cb] | 137 | wish to utilize it, apply the following patch:</para>
|
---|
| 138 |
|
---|
| 139 | <screen><userinput>patch -Np1 -i ../php-&php-version;-db43-1.patch</userinput></screen>
|
---|
| 140 |
|
---|
| 141 | <para>Install <application>PHP</application> by
|
---|
| 142 | running the following commands:</para>
|
---|
| 143 |
|
---|
| 144 | <screen><userinput>./configure --prefix=/usr \
|
---|
[4a93a3c] | 145 | --sysconfdir=/etc \
|
---|
| 146 | --with-apxs2 \
|
---|
| 147 | --with-config-file-path=/etc \
|
---|
| 148 | --with-zlib \
|
---|
[5056a3b] | 149 | --enable-bcmath \
|
---|
[4a93a3c] | 150 | --with-bz2 \
|
---|
[990f983] | 151 | --enable-calendar \
|
---|
[dfb9157] | 152 | --enable-dba \
|
---|
[5056a3b] | 153 | --enable-exif \
|
---|
[4a93a3c] | 154 | --enable-ftp \
|
---|
| 155 | --with-gettext \
|
---|
| 156 | --with-iconv \
|
---|
[fbbf93e] | 157 | --enable-mbstring \
|
---|
[36c668d] | 158 | --with-ncurses \
|
---|
[c1e05756] | 159 | --with-readline \
|
---|
[36c668d] | 160 | --disable-libxml &&
|
---|
[db81e4cb] | 161 | make</userinput></screen>
|
---|
| 162 |
|
---|
[1f01e7e7] | 163 | <para>To test the results, issue: <command>make test</command>.</para>
|
---|
| 164 |
|
---|
[db81e4cb] | 165 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
| 166 |
|
---|
| 167 | <screen role="root"><userinput>make install &&
|
---|
[5cc1126a] | 168 | cp -v php.ini-recommended /etc/php.ini</userinput></screen>
|
---|
[db81e4cb] | 169 |
|
---|
| 170 | <para>Remove the <option>--disable-libxml</option> switch if you
|
---|
| 171 | have <xref linkend="libxml2"/> installed otherwise
|
---|
| 172 | <command>pear</command> will not be built.</para>
|
---|
| 173 |
|
---|
| 174 | <note>
|
---|
[7cd76d62] | 175 | <para><application>PHP</application> has many more configure
|
---|
[db81e4cb] | 176 | options that will enable support for certain things. You can use
|
---|
| 177 | <command>./configure --help</command> to see a full list of the
|
---|
| 178 | available options. Also, use of the
|
---|
| 179 | <ulink url="http://www.php.net/">PHP web site</ulink>
|
---|
| 180 | is highly recommended, as their online docs are very good.</para>
|
---|
| 181 | </note>
|
---|
| 182 |
|
---|
| 183 | </sect2>
|
---|
| 184 |
|
---|
| 185 | <sect2 role="configuration">
|
---|
| 186 | <title>Configuring PHP</title>
|
---|
| 187 |
|
---|
| 188 | <sect3 id="php-config">
|
---|
| 189 | <title>Config Files</title>
|
---|
| 190 |
|
---|
| 191 | <para><filename>/etc/php.ini</filename>,
|
---|
| 192 | <filename>/etc/pear.conf</filename></para>
|
---|
| 193 |
|
---|
| 194 | <indexterm zone="php php-config">
|
---|
| 195 | <primary sortas="e-etc-php.ini">/etc/php.ini</primary>
|
---|
| 196 | </indexterm>
|
---|
| 197 |
|
---|
| 198 | <indexterm zone="php php-config">
|
---|
| 199 | <primary sortas="e-etc-pear.conf">/etc/pear.conf</primary>
|
---|
| 200 | </indexterm>
|
---|
| 201 |
|
---|
| 202 | </sect3>
|
---|
| 203 |
|
---|
| 204 | <sect3>
|
---|
| 205 | <title>Configuration Information</title>
|
---|
| 206 |
|
---|
[0619e6d] | 207 | <para>To enable PHP support in the <application>Apache</application>
|
---|
[db81e4cb] | 208 | web server, a new LoadModule (which should be handled automatically by the
|
---|
[7cd76d62] | 209 | <command>make install</command> command) and AddType directives
|
---|
[db81e4cb] | 210 | must be added to the <filename>httpd.conf</filename> file:</para>
|
---|
| 211 |
|
---|
| 212 | <screen><literal>LoadModule php5_module lib/apache/libphp5.so
|
---|
| 213 | AddType application/x-httpd-php .php</literal></screen>
|
---|
| 214 |
|
---|
[7cd76d62] | 215 | <para>Also, it can be useful to add an entry for
|
---|
| 216 | <filename>index.php</filename> to the DirectoryIndex directive of the
|
---|
[db81e4cb] | 217 | <filename>httpd.conf</filename> file.</para>
|
---|
| 218 |
|
---|
[7cd76d62] | 219 | <para>You'll need to restart the <application>Apache</application> web server
|
---|
[0619e6d] | 220 | after making any modifications to the <filename>httpd.conf</filename>
|
---|
[db81e4cb] | 221 | file.</para>
|
---|
| 222 |
|
---|
| 223 | </sect3>
|
---|
| 224 |
|
---|
| 225 | </sect2>
|
---|
| 226 |
|
---|
| 227 | <sect2 role="content">
|
---|
| 228 | <title>Contents</title>
|
---|
| 229 |
|
---|
| 230 | <segmentedlist>
|
---|
| 231 | <segtitle>Installed Programs</segtitle>
|
---|
| 232 | <segtitle>Installed Library</segtitle>
|
---|
| 233 | <segtitle>Installed Directories</segtitle>
|
---|
| 234 |
|
---|
| 235 | <seglistitem>
|
---|
| 236 | <seg>pear, php, php-config, phpextdist, and phpize</seg>
|
---|
| 237 | <seg>libphp5.so</seg>
|
---|
| 238 | <seg>/usr/include/php and /usr/lib/php</seg>
|
---|
| 239 | </seglistitem>
|
---|
| 240 | </segmentedlist>
|
---|
| 241 |
|
---|
| 242 | <variablelist>
|
---|
| 243 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 244 | <?dbfo list-presentation="list"?>
|
---|
| 245 | <?dbhtml list-presentation="table"?>
|
---|
| 246 |
|
---|
| 247 | <varlistentry id="php-prog">
|
---|
| 248 | <term><command>php</command></term>
|
---|
| 249 | <listitem>
|
---|
[7cd76d62] | 250 | <para>is a command line interface that enables you to parse and
|
---|
[db81e4cb] | 251 | execute PHP code.</para>
|
---|
| 252 | <indexterm zone="php php-prog">
|
---|
| 253 | <primary sortas="b-php">php</primary>
|
---|
| 254 | </indexterm>
|
---|
| 255 | </listitem>
|
---|
| 256 | </varlistentry>
|
---|
| 257 |
|
---|
| 258 | <varlistentry id="pear">
|
---|
| 259 | <term><command>pear</command></term>
|
---|
| 260 | <listitem>
|
---|
[7cd76d62] | 261 | <para>is the PHP Extension and Application
|
---|
[db81e4cb] | 262 | Repository (PEAR) package manager.</para>
|
---|
| 263 | <indexterm zone="php pear">
|
---|
| 264 | <primary sortas="b-pear">pear</primary>
|
---|
| 265 | </indexterm>
|
---|
| 266 | </listitem>
|
---|
| 267 | </varlistentry>
|
---|
| 268 |
|
---|
| 269 | </variablelist>
|
---|
| 270 |
|
---|
| 271 | </sect2>
|
---|
[f45b1953] | 272 |
|
---|
| 273 | </sect1>
|
---|