[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;">
|
---|
[a0f03b0] | 16 | <sect1info>
|
---|
[5cd0959d] | 17 | <othername>$LastChangedBy$</othername>
|
---|
| 18 | <date>$Date$</date>
|
---|
[a0f03b0] | 19 | </sect1info>
|
---|
[00bb024c] | 20 | <?dbhtml filename="php.html"?>
|
---|
[6683a00] | 21 | <title><acronym>PHP</acronym>-&php-version;</title>
|
---|
[b9d1118] | 22 | <indexterm zone="php">
|
---|
| 23 | <primary sortas="a-PHP">PHP</primary></indexterm>
|
---|
[f45b1953] | 24 |
|
---|
[08254fc] | 25 | <sect2>
|
---|
| 26 | <title>Introduction to <application><acronym>PHP</acronym></application></title>
|
---|
| 27 |
|
---|
[7bc4c361] | 28 | <para><application><acronym>PHP</acronym></application> is the
|
---|
| 29 | <acronym>PHP</acronym> Hypertext Preprocessor. Primarily used in dynamic web
|
---|
| 30 | sites, it allows for programming code to be directly embedded into the
|
---|
[08254fc] | 31 | <acronym>HTML</acronym> markup.</para>
|
---|
| 32 |
|
---|
| 33 | <sect3><title>Package information</title>
|
---|
| 34 | <itemizedlist spacing='compact'>
|
---|
[7bc4c361] | 35 | <listitem><para>Download (HTTP):
|
---|
| 36 | <ulink url="&php-download-http;"/></para></listitem>
|
---|
| 37 | <listitem><para>Download (FTP):
|
---|
| 38 | <ulink url="&php-download-ftp;"/></para></listitem>
|
---|
| 39 | <listitem><para>Download MD5 sum: &php-md5sum;</para></listitem>
|
---|
[08254fc] | 40 | <listitem><para>Download size: &php-size;</para></listitem>
|
---|
[7bc4c361] | 41 | <listitem><para>Estimated disk space required:
|
---|
| 42 | &php-buildsize;</para></listitem>
|
---|
| 43 | <listitem><para>Estimated build time:
|
---|
| 44 | &php-time;</para></listitem></itemizedlist>
|
---|
[08254fc] | 45 | </sect3>
|
---|
| 46 |
|
---|
[93c1bf51] | 47 | <sect3><title>Additional downloads</title>
|
---|
| 48 | <itemizedlist spacing="compact">
|
---|
| 49 | <listitem><para>Required patch for Berkeley DB: <ulink
|
---|
| 50 | url="&patch-root;/php-&php-version;-db43-1.patch"/></para>
|
---|
| 51 | </listitem></itemizedlist>
|
---|
| 52 | </sect3>
|
---|
| 53 |
|
---|
[7bc4c361] | 54 | <sect3><title><application><acronym>PHP</acronym></application>
|
---|
| 55 | dependencies</title>
|
---|
[08254fc] | 56 | <sect4><title>Required</title>
|
---|
[7bc4c361] | 57 | <para><xref linkend="apache"/></para>
|
---|
| 58 | </sect4>
|
---|
| 59 |
|
---|
[08254fc] | 60 | <sect4><title>Optional</title>
|
---|
[7bc4c361] | 61 | <para><xref linkend="libxml2"/>,
|
---|
[4a93a3c] | 62 | <xref linkend="libxslt"/>,
|
---|
[cef3a2f] | 63 | <xref linkend="openssl"/>,
|
---|
[4a93a3c] | 64 | <ulink url="http://www.fastio.com/">ClibPDF</ulink>,
|
---|
| 65 | <xref linkend="libjpeg"/>,
|
---|
| 66 | <xref linkend="libtiff"/>,
|
---|
[08254fc] | 67 | <xref linkend="curl"/>,
|
---|
[4a93a3c] | 68 | <ulink url="http://qdbm.sourceforge.net/">QDBM</ulink>,
|
---|
[dfb9157] | 69 | <ulink url="http://cr.yp.to/cdb.html">cdb</ulink>,
|
---|
[4a93a3c] | 70 | <xref linkend="gdbm"/>,
|
---|
[08254fc] | 71 | <xref linkend="db"/>,
|
---|
[4a93a3c] | 72 | <xref linkend="fam"/>,
|
---|
| 73 | <ulink url="http://www.boutell.com/gd/">GD</ulink>,
|
---|
[08254fc] | 74 | <xref linkend="libpng"/>,
|
---|
[4a93a3c] | 75 | X (<xref linkend="xorg"/> or <xref linkend="xfree86"/>),
|
---|
[08254fc] | 76 | <xref linkend="freetype2"/>,
|
---|
[7bc4c361] | 77 | <ulink
|
---|
| 78 | url="http://gd.tuwien.ac.at/visual/ibiblio/libs/graphics/t1lib-5.0.2.tar.gz">
|
---|
| 79 | t1lib</ulink>,
|
---|
[4a93a3c] | 80 | <xref linkend="gmp"/>
|
---|
| 81 | <xref linkend="mysql"/>,
|
---|
[08254fc] | 82 | <xref linkend="pcre"/>,
|
---|
| 83 | <xref linkend="postgresql"/>,
|
---|
[c1e05756] | 84 | <xref linkend="aspell"/>,
|
---|
| 85 | <xref linkend="pkgconfig"/>,
|
---|
[0fb1ed2] | 86 | <xref linkend="html-tidy"/>,
|
---|
[4a93a3c] | 87 | <xref linkend="openldap"/>,
|
---|
[c1e05756] | 88 | <xref linkend="cyrus-sasl"/>,
|
---|
[4a93a3c] | 89 | <xref linkend="mitkrb"/> or <xref linkend="heimdal"/>,
|
---|
| 90 | <ulink url="http://mcrypt.hellug.gr/">libmcrypt</ulink>,
|
---|
| 91 | <ulink url="http://mhash.sourceforge.net/">mhash</ulink>,
|
---|
[c1e05756] | 92 | <ulink url="http://www.net-snmp.org/">Net-SNMP</ulink>,
|
---|
| 93 | <ulink url="http://www.sqlite.org/">SQLite</ulink>,
|
---|
| 94 | <ulink url="http://dmalloc.com/">Dmalloc</ulink>,
|
---|
[ef9c039] | 95 | <ulink url="http://www.mnogosearch.org/">mnoGoSearch</ulink>,
|
---|
[ddfee75] | 96 | <ulink url="http://www.hughes.com.au/products/msql/">Mini SQL</ulink>,
|
---|
| 97 | <ulink url="http://www.empress.com/">Empress</ulink>,
|
---|
| 98 | <ulink url="http://www.birdstep.com/">Birdstep</ulink>,
|
---|
| 99 | <ulink url="http://www.dbmaker.com/">DBMaker</ulink>,
|
---|
| 100 | <ulink url="http://www.softwareag.com/">Adabas</ulink>,
|
---|
| 101 | <ulink url="http://www.frontbase.com/">FrontBase</ulink>,
|
---|
| 102 | <ulink url="http://caudium.net/">Caudium</ulink>,
|
---|
| 103 | <ulink url="http://www.openwddx.org/">WDDX</ulink>,
|
---|
[7bc4c361] | 104 | <ulink url="http://partners.adobe.com/asn/acrobat/forms.jsp">
|
---|
| 105 | FDF Toolkit</ulink>,
|
---|
[2077998d] | 106 | <ulink url="http://www.hyperwave.com/">Hyperwave</ulink>,
|
---|
| 107 | <ulink url="http://www.mainstreetsoftworks.com/">Monetra</ulink>,
|
---|
[08254fc] | 108 | <xref linkend="expat"/> and
|
---|
[7bc4c361] | 109 | <ulink url="../server/mail.html">MTA</ulink></para>
|
---|
| 110 | </sect4>
|
---|
[08254fc] | 111 | </sect3>
|
---|
| 112 |
|
---|
| 113 | </sect2>
|
---|
| 114 |
|
---|
| 115 | <sect2>
|
---|
| 116 | <title>Installation of <application><acronym>PHP</acronym></application></title>
|
---|
| 117 |
|
---|
[4a93a3c] | 118 | <note><para>You can use <application><acronym>PHP</acronym></application>
|
---|
| 119 | for server-side scripting, command line scripting or client-side
|
---|
| 120 | <acronym>GUI</acronym> applications. The book provides instructions for
|
---|
| 121 | setting up <application><acronym>PHP</acronym></application> for
|
---|
| 122 | server-side scripting as it is the most common form.</para></note>
|
---|
| 123 |
|
---|
[93c1bf51] | 124 | <para>If you have Berkeley DB installed and wish to utilize it, apply
|
---|
| 125 | the following patch:</para>
|
---|
| 126 |
|
---|
[abc0c08] | 127 | <screen><userinput><command>patch -Np1 -i ../php-&php-version;-db43-1.patch</command></userinput></screen>
|
---|
[93c1bf51] | 128 |
|
---|
[08254fc] | 129 | <para>Install <application><acronym>PHP</acronym></application> by
|
---|
| 130 | running the following commands:</para>
|
---|
| 131 |
|
---|
[4a93a3c] | 132 | <screen><userinput><command>./configure --prefix=/usr \
|
---|
| 133 | --sysconfdir=/etc \
|
---|
| 134 | --with-apxs2 \
|
---|
| 135 | --with-config-file-path=/etc \
|
---|
| 136 | --with-zlib \
|
---|
[5056a3b] | 137 | --enable-bcmath \
|
---|
[4a93a3c] | 138 | --with-bz2 \
|
---|
[990f983] | 139 | --enable-calendar \
|
---|
[dfb9157] | 140 | --enable-dba \
|
---|
[5056a3b] | 141 | --enable-exif \
|
---|
[4a93a3c] | 142 | --enable-ftp \
|
---|
| 143 | --with-gettext \
|
---|
| 144 | --with-iconv \
|
---|
[fbbf93e] | 145 | --enable-mbstring \
|
---|
[36c668d] | 146 | --with-ncurses \
|
---|
[c1e05756] | 147 | --with-readline \
|
---|
[36c668d] | 148 | --disable-libxml &&
|
---|
[b9d1118] | 149 | make</command></userinput></screen>
|
---|
| 150 |
|
---|
| 151 | <para>Now, as the root user:</para>
|
---|
| 152 |
|
---|
| 153 | <screen><userinput role='root'><command>make install &&
|
---|
[08254fc] | 154 | cp php.ini-recommended /etc/php.ini</command></userinput></screen>
|
---|
| 155 |
|
---|
[84e42bc] | 156 | <para>Remove the <parameter>--disable-libxml</parameter> switch if you
|
---|
[dbf1c23] | 157 | have <xref linkend="libxml2"/> installed otherwise
|
---|
| 158 | <command>pear</command> will not be built.</para>
|
---|
| 159 |
|
---|
[08254fc] | 160 | <note><para><acronym>PHP</acronym> has many more configure options that
|
---|
| 161 | will enable support for certain things. You can use
|
---|
| 162 | <command>./configure --help</command> to see a full list of the
|
---|
| 163 | available options. Also, use of the
|
---|
| 164 | <ulink url="http://www.php.net/"><acronym>PHP</acronym> web site</ulink>
|
---|
| 165 | is highly recommended, as their online docs are very good.</para></note>
|
---|
| 166 |
|
---|
| 167 | </sect2>
|
---|
| 168 |
|
---|
| 169 | <sect2>
|
---|
| 170 | <title>Configuring <application><acronym>PHP</acronym></application></title>
|
---|
| 171 |
|
---|
[b9d1118] | 172 | <sect3 id="php-config"><title>Config files</title>
|
---|
[08254fc] | 173 | <para><filename>/etc/php.ini</filename>,
|
---|
| 174 | <filename>/etc/pear.conf</filename></para>
|
---|
[b9d1118] | 175 | <indexterm zone="php php-config">
|
---|
| 176 | <primary sortas="e-etc-php.ini">/etc/php.ini</primary></indexterm>
|
---|
| 177 | <indexterm zone="php php-config">
|
---|
| 178 | <primary sortas="e-etc-pear.conf">/etc/pear.conf</primary></indexterm>
|
---|
[08254fc] | 179 | </sect3>
|
---|
| 180 |
|
---|
| 181 | <sect3><title>Configuration Information</title>
|
---|
| 182 |
|
---|
| 183 | <para>To enable <acronym>PHP</acronym> support in the
|
---|
| 184 | <application>Apache</application> web server,
|
---|
[b9d1118] | 185 | a new LoadModule (which should be handled automatically by the
|
---|
[7bc4c361] | 186 | <command>make install</command> command) and AddType directives must be added
|
---|
| 187 | to the <filename>httpd.conf</filename> file:</para>
|
---|
[08254fc] | 188 |
|
---|
[4a93a3c] | 189 | <screen><userinput>LoadModule php5_module lib/apache/libphp5.so
|
---|
| 190 | AddType application/x-httpd-php .php</userinput></screen>
|
---|
[08254fc] | 191 |
|
---|
[7bc4c361] | 192 | <para>Also, it can be useful to add an entry for
|
---|
| 193 | <filename>index.php</filename> to the DirectoryIndex directive of the
|
---|
| 194 | <filename>httpd.conf</filename> file.</para>
|
---|
[08254fc] | 195 |
|
---|
[b9d1118] | 196 | <para>You'll need to restart the <application>Apache</application> web server
|
---|
| 197 | after making any modifications to the <filename>httpd.conf</filename>
|
---|
| 198 | file.</para>
|
---|
[08254fc] | 199 | </sect3>
|
---|
| 200 |
|
---|
| 201 | </sect2>
|
---|
| 202 |
|
---|
| 203 | <sect2>
|
---|
| 204 | <title>Contents</title>
|
---|
| 205 |
|
---|
[b9d1118] | 206 | <segmentedlist>
|
---|
| 207 | <segtitle>Installed Programs</segtitle>
|
---|
| 208 | <segtitle>Installed Library</segtitle>
|
---|
| 209 | <segtitle>Installed Directories</segtitle>
|
---|
| 210 |
|
---|
| 211 | <seglistitem>
|
---|
| 212 | <seg>pear, php, php-config, phpextdist and phpize</seg>
|
---|
| 213 | <seg>libphp5.so</seg>
|
---|
| 214 | <seg>/usr/include/php and /usr/lib/php</seg>
|
---|
| 215 | </seglistitem>
|
---|
| 216 | </segmentedlist>
|
---|
| 217 |
|
---|
| 218 | <variablelist>
|
---|
| 219 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 220 | <?dbfo list-presentation="list"?>
|
---|
| 221 |
|
---|
| 222 | <varlistentry id="php-prog">
|
---|
| 223 | <term><command>php</command></term>
|
---|
| 224 | <listitem><para>is a command line interface that enables you to parse and
|
---|
| 225 | execute <acronym>PHP</acronym> code.</para>
|
---|
| 226 | <indexterm zone="php php-prog">
|
---|
| 227 | <primary sortas="b-php">php</primary>
|
---|
| 228 | </indexterm></listitem>
|
---|
| 229 | </varlistentry>
|
---|
| 230 |
|
---|
| 231 | <varlistentry id="pear">
|
---|
| 232 | <term><command>pear</command></term>
|
---|
| 233 | <listitem><para>is the <acronym>PHP</acronym> Extension and Application
|
---|
| 234 | Repository (<acronym>PEAR</acronym>) package manager.</para>
|
---|
| 235 | <indexterm zone="php pear">
|
---|
| 236 | <primary sortas="b-pear">pear</primary>
|
---|
| 237 | </indexterm></listitem>
|
---|
| 238 | </varlistentry>
|
---|
| 239 | </variablelist>
|
---|
[6ea7ff9] | 240 |
|
---|
[08254fc] | 241 | </sect2>
|
---|
[f45b1953] | 242 |
|
---|
| 243 | </sect1>
|
---|