[08254fc] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[6732c094] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[08254fc] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[077b739] | 7 | <!ENTITY php-download-http "http://us2.php.net/distributions/php-&php-version;.tar.bz2">
|
---|
[3e9add2] | 8 | <!ENTITY php-download-ftp "ftp://ftp.isu.edu.tw/pub/Unix/Web/PHP/distributions/php-&php-version;.tar.bz2">
|
---|
[2e937f5] | 9 | <!ENTITY php-md5sum "b53e5f47c59ffbe26d20957636695baa">
|
---|
[077b739] | 10 | <!ENTITY php-size "13 MB">
|
---|
[2e937f5] | 11 | <!ENTITY php-buildsize "432 MB (additional 102 MB for documentation)">
|
---|
| 12 | <!ENTITY php-time "3.5 SBU (additional 1.8 SBU to run the test suite)">
|
---|
[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
|
---|
[0d7900a] | 34 | directly embedded into the HTML markup. It is also useful as a
|
---|
[a5db8d2] | 35 | general purpose scripting language.</para>
|
---|
| 36 |
|
---|
[0461254] | 37 | &lfs75_checked;
|
---|
[db81e4cb] | 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">
|
---|
[b84326b7] | 63 | <listitem>
|
---|
| 64 | <para>Pre-built documentation (optional): <ulink
|
---|
| 65 | url="http://www.php.net/download-docs.php"/></para>
|
---|
| 66 | </listitem>
|
---|
[db81e4cb] | 67 | </itemizedlist>
|
---|
| 68 |
|
---|
| 69 | <bridgehead renderas="sect3">PHP Dependencies</bridgehead>
|
---|
| 70 |
|
---|
[2f65edb] | 71 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
[2e4782e] | 72 | <para role="recommended">
|
---|
| 73 | <xref linkend="apache"/> and
|
---|
| 74 | <xref linkend="libxml2"/>
|
---|
| 75 | </para>
|
---|
[2f65edb] | 76 |
|
---|
[b84326b7] | 77 | <bridgehead renderas="sect4">Optional System Utilities and Libraries</bridgehead>
|
---|
[256ee72c] | 78 | <para role="optional"><xref linkend="libxslt"/>,
|
---|
[e797436] | 79 | <!-- <xref linkend="gamin"/>, -->
|
---|
[db81e4cb] | 80 | <xref linkend="pcre"/>,
|
---|
| 81 | <xref linkend="aspell"/>,
|
---|
[0fb9d5f] | 82 | <xref linkend="enchant"/>,
|
---|
[2e937f5] | 83 | <xref linkend="pth"/>,
|
---|
| 84 | an <xref linkend="server-mail"/> (that provides a
|
---|
| 85 | <command>sendmail</command> command)
|
---|
[b3799be4] | 86 | <ulink url="http://www.ossp.org/pkg/lib/mm/">OSSP mm</ulink>,
|
---|
[db81e4cb] | 87 | <ulink url="http://www.net-snmp.org/">Net-SNMP</ulink>,
|
---|
[ba1a38b] | 88 | <ulink url="http://re2c.org/">re2c</ulink>,
|
---|
[2e937f5] | 89 | <ulink url="http://xmlrpc-epi.sourceforge.net/main.php?t=php_about">XMLRPC-EPI</ulink>, and
|
---|
| 90 | <ulink url="http://dmalloc.com/">Dmalloc</ulink></para>
|
---|
[b84326b7] | 91 |
|
---|
| 92 | <bridgehead renderas="sect4">Optional Graphics Utilities and Libraries</bridgehead>
|
---|
[256ee72c] | 93 | <para role="optional"><xref linkend="libjpeg"/>,
|
---|
[b84326b7] | 94 | <xref linkend="libtiff"/>,
|
---|
| 95 | <xref linkend="libpng"/>,
|
---|
[ba1a38b] | 96 | <xref linkend="libexif"/>,
|
---|
[b84326b7] | 97 | <xref linkend="freetype2"/>,
|
---|
[e77976f] | 98 | <xref linkend="x-window-system"/>,
|
---|
[b84326b7] | 99 | <ulink url="http://www.fastio.com/">ClibPDF</ulink>,
|
---|
[e4658bf] | 100 | <ulink url="https://bitbucket.org/libgd/gd-libgd/downloads">GD</ulink>,
|
---|
[a754ee2b] | 101 | <ulink url="http://fossies.org/linux/misc/t1lib-5.1.2.tar.gz/">t1lib</ulink>, and
|
---|
[1c345ed] | 102 | <ulink url="http://www.adobe.com/devnet/acrobat/fdftoolkit.html">FDF Toolkit</ulink></para>
|
---|
[b84326b7] | 103 |
|
---|
| 104 | <bridgehead renderas="sect4">Optional Web Utilities</bridgehead>
|
---|
[256ee72c] | 105 | <para role="optional"><xref linkend="curl"/>,
|
---|
[b84326b7] | 106 | <xref linkend="html-tidy"/>,
|
---|
[db81e4cb] | 107 | <ulink url="http://www.mnogosearch.org/">mnoGoSearch</ulink>,
|
---|
[b84326b7] | 108 | <ulink url="http://www.hyperwave.com/">Hyperwave</ulink>,
|
---|
[ba1a38b] | 109 | <ulink url="http://www.roxen.com/products/webserver/">Roxen WebServer</ulink>,
|
---|
[a6350ea] | 110 | <ulink url="http://sourceforge.net/projects/caudium/">Caudium</ulink>, and
|
---|
[a754ee2b] | 111 | <ulink url="https://wddxnet.codeplex.com/">WDDX</ulink></para>
|
---|
[b84326b7] | 112 |
|
---|
| 113 | <bridgehead renderas="sect4">Optional Data Management Utilities and Libraries</bridgehead>
|
---|
[256ee72c] | 114 | <para role="optional"><xref linkend="openldap"/>,
|
---|
[de7f20e] | 115 | <!-- <xref linkend="gdbm"/>, -->
|
---|
| 116 | <xref linkend="db"/>,
|
---|
[5e0662d] | 117 | <xref linkend="mariadb"/> or <ulink url="http://www.mysql.com/">MySQL</ulink>,
|
---|
[b84326b7] | 118 | <xref linkend="postgresql"/>,
|
---|
[76b19ad] | 119 | <xref linkend="unixodbc"/>,
|
---|
[8f9c757e] | 120 | <xref linkend="sqlite"/>,
|
---|
[a6350ea] | 121 | <ulink url="http://sourceforge.net/projects/qdbm">QDBM</ulink>,
|
---|
[b84326b7] | 122 | <ulink url="http://cr.yp.to/cdb.html">cdb</ulink>,
|
---|
[db81e4cb] | 123 | <ulink url="http://www.hughes.com.au/products/msql/">Mini SQL</ulink>,
|
---|
| 124 | <ulink url="http://www.empress.com/">Empress</ulink>,
|
---|
| 125 | <ulink url="http://www.birdstep.com/">Birdstep</ulink>,
|
---|
| 126 | <ulink url="http://www.dbmaker.com/">DBMaker</ulink>,
|
---|
| 127 | <ulink url="http://www.softwareag.com/">Adabas</ulink>,
|
---|
[3f87e4a] | 128 | <ulink url="http://www.frontbase.com/">FrontBase</ulink>, and
|
---|
[b84326b7] | 129 | <ulink url="http://www.mainstreetsoftworks.com/">Monetra</ulink></para>
|
---|
| 130 |
|
---|
[e797436] | 131 | <para><application>PHP</application> also provides support for many
|
---|
| 132 | commercial database tools such as <application>Oracle</application>,
|
---|
| 133 | <application>SAP</application> and
|
---|
| 134 | <application>ODBC Router</application>.</para>
|
---|
| 135 |
|
---|
[b84326b7] | 136 | <bridgehead renderas="sect4">Optional Security/Encryption Utilities and Libraries</bridgehead>
|
---|
[256ee72c] | 137 | <para role="optional"><xref linkend="openssl"/>,
|
---|
[b84326b7] | 138 | <xref linkend="cyrus-sasl"/>,
|
---|
[7fdeb26] | 139 | <xref linkend="mitkrb"/>,
|
---|
[3f87e4a] | 140 | <ulink url="http://mcrypt.sourceforge.net/">libmcrypt</ulink>, and
|
---|
[b84326b7] | 141 | <ulink url="http://mhash.sourceforge.net/">mhash</ulink></para>
|
---|
[db81e4cb] | 142 |
|
---|
[1039de3] | 143 | <para condition="html" role="usernotes">User Notes:
|
---|
| 144 | <ulink url="&blfs-wiki;/php"/></para>
|
---|
| 145 |
|
---|
[db81e4cb] | 146 | </sect2>
|
---|
| 147 |
|
---|
| 148 | <sect2 role="installation">
|
---|
| 149 | <title>Installation of PHP</title>
|
---|
| 150 |
|
---|
[e797436] | 151 | <para>You can use <application>PHP</application> for server-side
|
---|
| 152 | scripting, command-line scripting or client-side GUI applications. This
|
---|
| 153 | book provides instructions for setting up <application>PHP</application>
|
---|
| 154 | for server-side scripting as it is the most common form.</para>
|
---|
[db81e4cb] | 155 |
|
---|
[b84326b7] | 156 | <note>
|
---|
| 157 | <para><application>PHP</application> has many more
|
---|
[ba1a38b] | 158 | <command>configure</command> options that will enable support for various
|
---|
[b84326b7] | 159 | things. You can use <command>./configure --help</command> to see a full
|
---|
| 160 | list of the available options. Also, use of the
|
---|
| 161 | <ulink url="http://www.php.net/">PHP web site</ulink>
|
---|
[e797436] | 162 | is highly recommended, as their online docs are very good. An example of
|
---|
| 163 | a <command>configure</command> command that utilizes many of the most
|
---|
| 164 | common dependencies can be found at <ulink
|
---|
[4e88613] | 165 | url="&files-anduin;/php_configure.txt"/>.
|
---|
[e797436] | 166 | </para>
|
---|
[3f87e4a] | 167 |
|
---|
| 168 | <para>If, for whatever reason, you don't have <xref linkend="libxml2"/>
|
---|
| 169 | installed, you need to add <option>--disable-libxml</option> to the
|
---|
[e797436] | 170 | <command>configure</command> command in the instructions below. Note that
|
---|
| 171 | this will prevent the <command>pear</command> command from being
|
---|
| 172 | built.</para>
|
---|
[b84326b7] | 173 | </note>
|
---|
| 174 |
|
---|
[db81e4cb] | 175 | <para>Install <application>PHP</application> by
|
---|
| 176 | running the following commands:</para>
|
---|
| 177 |
|
---|
[3e9add2] | 178 | <screen><userinput>sed -i -e 's/2.6.5 2.7/& 3.0/' configure &&
|
---|
[e457b0f3] | 179 | ./configure --prefix=/usr \
|
---|
[75033b6] | 180 | --sysconfdir=/etc \
|
---|
[5178bbf6] | 181 | --localstatedir=/var \
|
---|
| 182 | --datadir=/usr/share/php \
|
---|
[81b5be3] | 183 | --mandir=/usr/share/man \
|
---|
[5178bbf6] | 184 | --enable-fpm \
|
---|
| 185 | --with-fpm-user=apache \
|
---|
| 186 | --with-fpm-group=apache \
|
---|
[4a93a3c] | 187 | --with-config-file-path=/etc \
|
---|
[75033b6] | 188 | --with-zlib \
|
---|
| 189 | --enable-bcmath \
|
---|
| 190 | --with-bz2 \
|
---|
| 191 | --enable-calendar \
|
---|
| 192 | --enable-dba=shared \
|
---|
| 193 | --with-gdbm \
|
---|
| 194 | --with-gmp \
|
---|
| 195 | --enable-ftp \
|
---|
| 196 | --with-gettext \
|
---|
| 197 | --enable-mbstring \
|
---|
| 198 | --with-readline &&
|
---|
[db81e4cb] | 199 | make</userinput></screen>
|
---|
| 200 |
|
---|
[75033b6] | 201 | <para>To test the results, issue: <command>make test</command>. A few
|
---|
[0cd10a6c] | 202 | tests may fail, in which case you are asked whether you want to send
|
---|
| 203 | the report to the PHP developpers. If you want to automate the test,
|
---|
| 204 | you may prefix the command with <command>yes "n" | </command>.</para>
|
---|
[d6f7e6cb] | 205 |
|
---|
[db81e4cb] | 206 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
| 207 |
|
---|
[81b5be3] | 208 | <!-- dev note: make INSTALL_ROOT=<DESTDIR> install -->
|
---|
| 209 |
|
---|
[75033b6] | 210 | <screen role="root"><userinput>make install &&
|
---|
| 211 | install -v -m644 php.ini-production /etc/php.ini &&
|
---|
[5178bbf6] | 212 | mv -v /etc/php-fpm.conf{.default,} &&
|
---|
[d6f7e6cb] | 213 |
|
---|
[ba1a38b] | 214 | install -v -m755 -d /usr/share/doc/php-&php-version; &&
|
---|
[75033b6] | 215 | install -v -m644 CODING_STANDARDS EXTENSIONS INSTALL NEWS README* UPGRADING* php.gif \
|
---|
[5a464e4d] | 216 | /usr/share/doc/php-&php-version; &&
|
---|
| 217 | ln -v -sfn /usr/lib/php/doc/Archive_Tar/docs/Archive_Tar.txt \
|
---|
| 218 | /usr/share/doc/php-&php-version; &&
|
---|
| 219 | ln -v -sfn /usr/lib/php/doc/Structures_Graph/docs \
|
---|
| 220 | /usr/share/doc/php-&php-version;</userinput></screen>
|
---|
[db81e4cb] | 221 |
|
---|
[b84326b7] | 222 | <para>The pre-built HTML documentation is packaged in two forms: a tarball
|
---|
| 223 | containing many individual files, useful for quick loading into your
|
---|
[ba1a38b] | 224 | browser, and one large individual file, which is useful for using the
|
---|
| 225 | search utility of your browser. If you downloaded either, or both, of the
|
---|
| 226 | documentation files, issue the following commands as the
|
---|
| 227 | <systemitem class='username'>root</systemitem> user to install them (note
|
---|
[b84326b7] | 228 | these instructions assume English docs, modify the tarball names below if
|
---|
| 229 | necessary).</para>
|
---|
[db81e4cb] | 230 |
|
---|
[ba1a38b] | 231 | <para>For the <quote>Single HTML</quote> file:</para>
|
---|
[b84326b7] | 232 |
|
---|
| 233 | <screen role="root"><userinput>install -v -m644 ../php_manual_en.html.gz \
|
---|
| 234 | /usr/share/doc/php-&php-version; &&
|
---|
| 235 | gunzip -v /usr/share/doc/php-&php-version;/php_manual_en.html.gz</userinput></screen>
|
---|
| 236 |
|
---|
| 237 | <para>For the <quote>Many HTML files</quote> tarball:</para>
|
---|
| 238 |
|
---|
[0fb9d5f] | 239 | <screen role="root"><userinput>tar -xvf ../php_manual_en.tar.gz \
|
---|
[a5db8d2] | 240 | -C /usr/share/doc/php-&php-version; --no-same-owner</userinput></screen>
|
---|
[db81e4cb] | 241 |
|
---|
| 242 | </sect2>
|
---|
[b84326b7] | 243 |
|
---|
[934c9b26] | 244 | <sect2 role="commands">
|
---|
| 245 | <title>Command Explanations</title>
|
---|
[db81e4cb] | 246 |
|
---|
[e457b0f3] | 247 | <para><command>sed -i -e 's/2.6.5 2.7/& 3.0/' configure</command>: Make
|
---|
| 248 | <filename>configure</filename> accept the version 3.0 of
|
---|
| 249 | <application>Bison</application> as a valid version.</para>
|
---|
| 250 |
|
---|
[5178bbf6] | 251 | <para><parameter>--with-datadir=/usr/share/php</parameter>: This works
|
---|
| 252 | around a bug in the build machinery, which installs some data to a
|
---|
| 253 | wrong location.</para>
|
---|
| 254 |
|
---|
| 255 | <para><parameter>--enable-fpm</parameter>: This parameter allows
|
---|
| 256 | building the fastCGI Process Manager.</para>
|
---|
[934c9b26] | 257 |
|
---|
| 258 | <para><parameter>--with-config-file-path=/etc</parameter>: This parameter
|
---|
[ba1a38b] | 259 | makes <application>PHP</application> look for the
|
---|
| 260 | <filename>php.ini</filename> configuration file in
|
---|
| 261 | <filename class='directory'>/etc</filename>.</para>
|
---|
[934c9b26] | 262 |
|
---|
[bccbdaea] | 263 | <para><parameter>--with-zlib</parameter>: This parameter adds
|
---|
[3239e36] | 264 | support for <application>Zlib</application> compression.</para>
|
---|
[934c9b26] | 265 |
|
---|
[b84326b7] | 266 | <para><parameter>--enable-bcmath</parameter>: Enables
|
---|
| 267 | <command>bc</command> style precision math functions.</para>
|
---|
[bccbdaea] | 268 |
|
---|
[2f65edb] | 269 | <para><parameter>--with-bz2</parameter>: Adds support for
|
---|
[b84326b7] | 270 | <application>Bzip2</application> compression functions.</para>
|
---|
[934c9b26] | 271 |
|
---|
| 272 | <para><parameter>--enable-calendar</parameter>: This parameter
|
---|
| 273 | provides support for calendar conversion.</para>
|
---|
| 274 |
|
---|
[0fb9d5f] | 275 | <para><parameter>--enable-dba=shared</parameter>: This parameter enables
|
---|
[2f65edb] | 276 | support for database (dbm-style) abstraction layer functions.</para>
|
---|
[934c9b26] | 277 |
|
---|
| 278 | <para><parameter>--enable-ftp</parameter>: This parameter
|
---|
[3239e36] | 279 | enables FTP functions.</para>
|
---|
[934c9b26] | 280 |
|
---|
| 281 | <para><parameter>--with-gettext</parameter>: Enables functions
|
---|
[3239e36] | 282 | that use <application>Gettext</application> text translation.</para>
|
---|
[934c9b26] | 283 |
|
---|
| 284 | <para><parameter>--enable-mbstring</parameter>: This parameter
|
---|
| 285 | enables multibyte string support.</para>
|
---|
| 286 |
|
---|
| 287 | <para><parameter>--with-readline</parameter>: This parameter
|
---|
[b84326b7] | 288 | enables command line <application>Readline</application> support.</para>
|
---|
[934c9b26] | 289 |
|
---|
[51352d5] | 290 | <para><option>--with-mysql</option>: This option
|
---|
[2e0084d] | 291 | includes <application>MariaDB/MySQL</application> support.</para>
|
---|
| 292 |
|
---|
[5a464e4d] | 293 | <para><option>--disable-libxml</option>: This option
|
---|
[ba1a38b] | 294 | allows building PHP without <application>libxml2</application>
|
---|
[2f65edb] | 295 | installed.</para>
|
---|
[934c9b26] | 296 |
|
---|
[5178bbf6] | 297 | <para><option>--with-apxs2</option>: Instead of building the fastCGI process
|
---|
| 298 | manager, it is possible to build an <application>apache</application> module.
|
---|
| 299 | This has some performance penalty for heavy loaded servers, but may be easier
|
---|
| 300 | to set up. This switch is incompatible with the
|
---|
| 301 | <parameter>--enable-fpm</parameter> and <parameter>--with-fpm-...</parameter>
|
---|
| 302 | switches.</para>
|
---|
| 303 |
|
---|
[934c9b26] | 304 | </sect2>
|
---|
[bccbdaea] | 305 |
|
---|
[db81e4cb] | 306 | <sect2 role="configuration">
|
---|
| 307 | <title>Configuring PHP</title>
|
---|
| 308 |
|
---|
| 309 | <sect3 id="php-config">
|
---|
| 310 | <title>Config Files</title>
|
---|
| 311 |
|
---|
[5178bbf6] | 312 | <para><filename>/etc/php.ini</filename>,
|
---|
| 313 | <filename>/etc/pear.conf</filename> and
|
---|
| 314 | <filename>/etc/php-fpm.conf</filename></para>
|
---|
[db81e4cb] | 315 |
|
---|
| 316 | <indexterm zone="php php-config">
|
---|
| 317 | <primary sortas="e-etc-php.ini">/etc/php.ini</primary>
|
---|
| 318 | </indexterm>
|
---|
| 319 |
|
---|
| 320 | <indexterm zone="php php-config">
|
---|
| 321 | <primary sortas="e-etc-pear.conf">/etc/pear.conf</primary>
|
---|
| 322 | </indexterm>
|
---|
| 323 |
|
---|
[5178bbf6] | 324 | <indexterm zone="php php-config">
|
---|
| 325 | <primary sortas="e-etc-php-fpm.conf">/etc/php-fpm.conf</primary>
|
---|
| 326 | </indexterm>
|
---|
| 327 |
|
---|
[db81e4cb] | 328 | </sect3>
|
---|
| 329 |
|
---|
| 330 | <sect3>
|
---|
| 331 | <title>Configuration Information</title>
|
---|
| 332 |
|
---|
[e797436] | 333 | <para>The file used as the default <filename>/etc/php.ini</filename>
|
---|
| 334 | configuration file is recommended by the <application>PHP</application>
|
---|
| 335 | development team. This file modifies the default behavior of
|
---|
[254be7d3] | 336 | <application>PHP</application>. If no <filename>/etc/php.ini</filename>
|
---|
| 337 | is used, all configuration settings fall to the defaults. You should
|
---|
[e797436] | 338 | review the comments in this file and ensure the changes are acceptable
|
---|
| 339 | in your particular environment.</para>
|
---|
| 340 |
|
---|
[b84326b7] | 341 | <para>You may have noticed the following from the output of the
|
---|
| 342 | <command>make install</command> command:</para>
|
---|
| 343 |
|
---|
[7c1d541] | 344 | <screen><computeroutput>You may want to add: /usr/lib/php to your php.ini include_path</computeroutput></screen>
|
---|
[b84326b7] | 345 |
|
---|
| 346 | <para>If desired, add the entry using the following command as the
|
---|
| 347 | <systemitem class="username">root</systemitem> user:</para>
|
---|
| 348 |
|
---|
[7c1d541] | 349 | <screen role="root"><userinput>sed -i 's@php/includes"@&\ninclude_path = ".:/usr/lib/php"@' \
|
---|
[b84326b7] | 350 | /etc/php.ini</userinput></screen>
|
---|
| 351 |
|
---|
[5178bbf6] | 352 | <para>To enable fastCGI support in the <application>Apache</application>
|
---|
| 353 | web server, two LoadModule directives must be added to the
|
---|
| 354 | <filename>httpd.conf</filename> file. They are commented out, so just issue the
|
---|
| 355 | following command as <systemitem class="username">root</systemitem> user:</para>
|
---|
[db81e4cb] | 356 |
|
---|
[5178bbf6] | 357 | <screen role="root"><userinput>sed -i -e '/proxy_module/s/^#//' \
|
---|
[7f8868f] | 358 | -e '/proxy_fcgi_module/s/^#//' \
|
---|
[5178bbf6] | 359 | /etc/httpd/httpd.conf</userinput></screen>
|
---|
[db81e4cb] | 360 |
|
---|
[5178bbf6] | 361 | <para>Those modules accept various <command>ProxyPass</command>
|
---|
| 362 | directives. One possibility is (as the
|
---|
| 363 | <systemitem class="username">root</systemitem> user):</para>
|
---|
| 364 |
|
---|
| 365 | <screen role="root"><userinput>echo \
|
---|
[7f8868f] | 366 | 'ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/srv/www/$1' >> \
|
---|
[5178bbf6] | 367 | /etc/httpd/httpd.conf</userinput></screen>
|
---|
| 368 |
|
---|
| 369 | <para>Additionally, it may be useful to add an entry for
|
---|
[7cd76d62] | 370 | <filename>index.php</filename> to the DirectoryIndex directive of the
|
---|
[e797436] | 371 | <filename>httpd.conf</filename> file. Lastly, adding a line to setup the
|
---|
| 372 | <filename class='extension'>.phps</filename> extension to show
|
---|
| 373 | highlighted <application>PHP</application> source may be
|
---|
| 374 | desirable:</para>
|
---|
| 375 |
|
---|
| 376 | <screen><literal>AddType application/x-httpd-php-source .phps</literal></screen>
|
---|
[db81e4cb] | 377 |
|
---|
[7cd76d62] | 378 | <para>You'll need to restart the <application>Apache</application> web server
|
---|
[0619e6d] | 379 | after making any modifications to the <filename>httpd.conf</filename>
|
---|
[db81e4cb] | 380 | file.</para>
|
---|
| 381 |
|
---|
| 382 | </sect3>
|
---|
| 383 |
|
---|
[5178bbf6] | 384 | <sect3 id="php-init">
|
---|
| 385 | <title>Boot Script</title>
|
---|
| 386 |
|
---|
| 387 | <para>
|
---|
| 388 | To automatically start the <command>php-fpm</command> daemon when the
|
---|
| 389 | system is rebooted, install the
|
---|
| 390 | <filename>/etc/rc.d/init.d/php</filename> bootscript from the
|
---|
| 391 | <xref linkend="bootscripts"/> package as the
|
---|
| 392 | <systemitem class="username">root</systemitem> user:
|
---|
| 393 | </para>
|
---|
| 394 |
|
---|
| 395 | <indexterm zone="php php-init">
|
---|
| 396 | <primary sortas="f-php">php</primary>
|
---|
| 397 | </indexterm>
|
---|
| 398 |
|
---|
| 399 | <screen role="root"><userinput>make install-php</userinput></screen>
|
---|
| 400 | </sect3>
|
---|
| 401 |
|
---|
[db81e4cb] | 402 | </sect2>
|
---|
| 403 |
|
---|
| 404 | <sect2 role="content">
|
---|
| 405 | <title>Contents</title>
|
---|
| 406 |
|
---|
| 407 | <segmentedlist>
|
---|
| 408 | <segtitle>Installed Programs</segtitle>
|
---|
[1c345ed] | 409 | <segtitle>Installed Libraries</segtitle>
|
---|
[db81e4cb] | 410 | <segtitle>Installed Directories</segtitle>
|
---|
| 411 |
|
---|
| 412 | <seglistitem>
|
---|
[3e9add2] | 413 | <seg>pear, peardev, pecl, phar (symlink), phar.phar,
|
---|
[5178bbf6] | 414 | php, php-cgi, php-config, php-fpm, and phpize</seg>
|
---|
[1c345ed] | 415 | <seg>dba.{so,a} and opcache.{so,a} in
|
---|
[5178bbf6] | 416 | /usr/lib/php/extensions/no-debug-non-zts-20121212/</seg>
|
---|
| 417 | <seg>/usr/include/php, /usr/lib/php, /usr/share/php and
|
---|
[ba1a38b] | 418 | /usr/share/doc/php-&php-version;</seg>
|
---|
[db81e4cb] | 419 | </seglistitem>
|
---|
| 420 | </segmentedlist>
|
---|
| 421 |
|
---|
| 422 | <variablelist>
|
---|
| 423 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 424 | <?dbfo list-presentation="list"?>
|
---|
| 425 | <?dbhtml list-presentation="table"?>
|
---|
| 426 |
|
---|
| 427 | <varlistentry id="php-prog">
|
---|
| 428 | <term><command>php</command></term>
|
---|
| 429 | <listitem>
|
---|
[7cd76d62] | 430 | <para>is a command line interface that enables you to parse and
|
---|
[db81e4cb] | 431 | execute PHP code.</para>
|
---|
| 432 | <indexterm zone="php php-prog">
|
---|
| 433 | <primary sortas="b-php">php</primary>
|
---|
| 434 | </indexterm>
|
---|
| 435 | </listitem>
|
---|
| 436 | </varlistentry>
|
---|
| 437 |
|
---|
| 438 | <varlistentry id="pear">
|
---|
| 439 | <term><command>pear</command></term>
|
---|
| 440 | <listitem>
|
---|
[7cd76d62] | 441 | <para>is the PHP Extension and Application
|
---|
[db81e4cb] | 442 | Repository (PEAR) package manager.</para>
|
---|
| 443 | <indexterm zone="php pear">
|
---|
| 444 | <primary sortas="b-pear">pear</primary>
|
---|
| 445 | </indexterm>
|
---|
| 446 | </listitem>
|
---|
| 447 | </varlistentry>
|
---|
| 448 |
|
---|
[5178bbf6] | 449 | <varlistentry id="php-fpm">
|
---|
| 450 | <term><command>php-fpm</command></term>
|
---|
| 451 | <listitem>
|
---|
| 452 | <para>is the fastCGI process manager for PHP.</para>
|
---|
| 453 | <indexterm zone="php php-fpm">
|
---|
| 454 | <primary sortas="b-php-fpm">php-fpm</primary>
|
---|
| 455 | </indexterm>
|
---|
| 456 | </listitem>
|
---|
| 457 | </varlistentry>
|
---|
| 458 |
|
---|
[db81e4cb] | 459 | </variablelist>
|
---|
| 460 |
|
---|
| 461 | </sect2>
|
---|
[f45b1953] | 462 |
|
---|
| 463 | </sect1>
|
---|