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