[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">
|
---|
[0c54cea] | 8 | <!ENTITY php-download-ftp " ">
|
---|
[595e58e] | 9 | <!ENTITY php-md5sum "d604d688be17f4a05b99dbb7fb9581f4">
|
---|
[3cf45b8] | 10 | <!ENTITY php-size "12.2 MB">
|
---|
[595e58e] | 11 | <!ENTITY php-buildsize "451 MB (add 2 MB for tests, add 106 MB for docs)">
|
---|
[44a4e0a] | 12 | <!ENTITY php-time "4.4 SBU (add 3.9 SBU for tests)">
|
---|
[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 |
|
---|
[44a4e0a] | 39 | &lfs80_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="aspell"/>,
|
---|
| 96 | <xref linkend="enchant"/>,
|
---|
[604bf744] | 97 | <xref linkend="libxslt"/>,
|
---|
[577eb27] | 98 | an <xref linkend="server-mail"/> (that provides a
|
---|
[604bf744] | 99 | <command>sendmail</command> command),
|
---|
| 100 | <xref linkend="pcre"/>,
|
---|
| 101 | <xref linkend="pth"/>,
|
---|
| 102 | <ulink url="http://dmalloc.com/">Dmalloc</ulink>,
|
---|
[577eb27] | 103 | <ulink url="http://www.net-snmp.org/">Net-SNMP</ulink>,
|
---|
[604bf744] | 104 | <ulink url="http://www.ossp.org/pkg/lib/mm/">OSSP mm</ulink>,
|
---|
| 105 | <ulink url="http://re2c.org/">re2c</ulink>, and
|
---|
| 106 | <ulink url="http://xmlrpc-epi.sourceforge.net/main.php?t=php_about">XMLRPC-EPI</ulink>
|
---|
[577eb27] | 107 | </para>
|
---|
[b84326b7] | 108 |
|
---|
| 109 | <bridgehead renderas="sect4">Optional Graphics Utilities and Libraries</bridgehead>
|
---|
[577eb27] | 110 | <para role="optional">
|
---|
[604bf744] | 111 | <xref linkend="freetype2"/>,
|
---|
| 112 | <xref linkend="libexif"/>,
|
---|
[577eb27] | 113 | <xref linkend="libjpeg"/>,
|
---|
| 114 | <xref linkend="libpng"/>,
|
---|
[604bf744] | 115 | <xref linkend="libtiff"/>,
|
---|
[577eb27] | 116 | <xref linkend="x-window-system"/>,
|
---|
[b8efb1fb] | 117 | <!--<ulink url="http://www.fastio.com/">ClibPDF</ulink>, - site asks for username/password-->
|
---|
[604bf744] | 118 | <ulink url="http://www.adobe.com/devnet/acrobat/fdftoolkit.html">FDF Toolkit</ulink>,
|
---|
| 119 | <ulink url="https://bitbucket.org/libgd/gd-libgd/downloads">GD</ulink>, and
|
---|
[59d1550] | 120 | <ulink url="http://fossies.org/linux/misc/old/t1lib-5.1.2.tar.gz/">t1lib</ulink>
|
---|
[577eb27] | 121 | </para>
|
---|
[b84326b7] | 122 |
|
---|
| 123 | <bridgehead renderas="sect4">Optional Web Utilities</bridgehead>
|
---|
[577eb27] | 124 | <para role="optional">
|
---|
| 125 | <xref linkend="curl"/>,
|
---|
[2b65035a] | 126 | <xref linkend="tidy-html5"/>,
|
---|
[604bf744] | 127 | <ulink url="http://sourceforge.net/projects/caudium/">Caudium</ulink>,
|
---|
[bd86aa8] | 128 | <ulink url="https://www.hyperwave.com/en/">Hyperwave</ulink>,
|
---|
[604bf744] | 129 | <ulink url="http://www.mnogosearch.org/">mnoGoSearch</ulink>,
|
---|
| 130 | <ulink url="http://www.roxen.com/products/webserver/">Roxen WebServer</ulink>, and
|
---|
[577eb27] | 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">
|
---|
[3dda7b8] | 136 | <xref linkend="db"/> (Note that PHP does not officially support versions
|
---|
| 137 | above 5.3),
|
---|
[577eb27] | 138 | <xref linkend="mariadb"/> or <ulink url="http://www.mysql.com/">MySQL</ulink>,
|
---|
[604bf744] | 139 | <xref linkend="openldap"/>,
|
---|
[577eb27] | 140 | <xref linkend="postgresql"/>,
|
---|
| 141 | <xref linkend="sqlite"/>,
|
---|
[604bf744] | 142 | <xref linkend="unixodbc"/>,
|
---|
| 143 | <ulink url="http://www.softwareag.com/">Adabas</ulink>,
|
---|
[577eb27] | 144 | <ulink url="http://www.birdstep.com/">Birdstep</ulink>,
|
---|
[604bf744] | 145 | <ulink url="http://cr.yp.to/cdb.html">cdb</ulink>,
|
---|
[577eb27] | 146 | <ulink url="http://www.dbmaker.com/">DBMaker</ulink>,
|
---|
[604bf744] | 147 | <ulink url="http://www.empress.com/">Empress</ulink>,
|
---|
[b8efb1fb] | 148 | <ulink url="http://www.frontbase.com/cgi-bin/WebObjects/FBWebSite">FrontBase</ulink>,
|
---|
[604bf744] | 149 | <ulink url="http://www.hughes.com.au/products/msql/">Mini SQL</ulink>,
|
---|
| 150 | <ulink url="http://www.monetra.com/">Monetra</ulink>, and
|
---|
| 151 | <ulink url="http://sourceforge.net/projects/qdbm">QDBM</ulink>
|
---|
[577eb27] | 152 | </para>
|
---|
| 153 |
|
---|
| 154 | <para>
|
---|
| 155 | <application>PHP</application> also provides support for many
|
---|
| 156 | commercial database tools such as <application>Oracle</application>,
|
---|
| 157 | <application>SAP</application> and
|
---|
| 158 | <application>ODBC Router</application>.
|
---|
| 159 | </para>
|
---|
[e797436] | 160 |
|
---|
[b84326b7] | 161 | <bridgehead renderas="sect4">Optional Security/Encryption Utilities and Libraries</bridgehead>
|
---|
[577eb27] | 162 | <para role="optional">
|
---|
| 163 | <xref linkend="openssl"/>,
|
---|
| 164 | <xref linkend="cyrus-sasl"/>,
|
---|
| 165 | <xref linkend="mitkrb"/>,
|
---|
| 166 | <ulink url="http://mcrypt.sourceforge.net/">libmcrypt</ulink>, and
|
---|
| 167 | <ulink url="http://mhash.sourceforge.net/">mhash</ulink>
|
---|
| 168 | </para>
|
---|
[db81e4cb] | 169 |
|
---|
[577eb27] | 170 | <para condition="html" role="usernotes">
|
---|
| 171 | User Notes: <ulink url="&blfs-wiki;/php"/>
|
---|
| 172 | </para>
|
---|
[1039de3] | 173 |
|
---|
[db81e4cb] | 174 | </sect2>
|
---|
| 175 |
|
---|
| 176 | <sect2 role="installation">
|
---|
| 177 | <title>Installation of PHP</title>
|
---|
| 178 |
|
---|
[577eb27] | 179 | <para>
|
---|
| 180 | You can use <application>PHP</application> for server-side
|
---|
| 181 | scripting, command-line scripting or client-side GUI applications. This
|
---|
| 182 | book provides instructions for setting up <application>PHP</application>
|
---|
| 183 | for server-side scripting as it is the most common form.
|
---|
| 184 | </para>
|
---|
[db81e4cb] | 185 |
|
---|
[b84326b7] | 186 | <note>
|
---|
[577eb27] | 187 | <para>
|
---|
| 188 | <application>PHP</application> has many more
|
---|
| 189 | <command>configure</command> options that will enable support for
|
---|
| 190 | various things. You can use <command>./configure --help</command> to
|
---|
| 191 | see a full list of the available options. Also, use of the
|
---|
| 192 | <ulink url="http://www.php.net/">PHP web site</ulink>
|
---|
| 193 | is highly recommended, as their online docs are very good. An example
|
---|
| 194 | of a <command>configure</command> command that utilizes many of the
|
---|
| 195 | most common dependencies can be found at <ulink
|
---|
[a29486e4] | 196 | url="&sources-anduin-http;/files/php_configure.txt"/>.
|
---|
[e797436] | 197 | </para>
|
---|
[3f87e4a] | 198 |
|
---|
[577eb27] | 199 | <para>
|
---|
| 200 | If, for whatever reason, you don't have <xref linkend="libxml2"/>
|
---|
| 201 | installed, you need to add <option>--disable-libxml</option> to the
|
---|
| 202 | <command>configure</command> command in the instructions below. Note
|
---|
| 203 | that this will prevent the <command>pear</command> command from being
|
---|
| 204 | built.
|
---|
| 205 | </para>
|
---|
[b84326b7] | 206 | </note>
|
---|
[3cf45b8] | 207 | <!--
|
---|
[b8efb1fb] | 208 | <para>
|
---|
| 209 | If you wish to build <application>PHP</application> with the
|
---|
| 210 | <application>tidy-html5</application> library, due to API changes, in the
|
---|
| 211 | <application>PHP</application> source, <filename>buffio.h</filename>
|
---|
| 212 | header needs to be changed to <filename>tidybuffio.h</filename> in the
|
---|
| 213 | file <filename>ext/tidy/tidy.c</filename>:
|
---|
| 214 | </para>
|
---|
| 215 |
|
---|
[3bbde8b5] | 216 | <screen><userinput>sed -i 's/buffio.h/tidy&/' ext/tidy/tidy.c</userinput></screen>
|
---|
[3cf45b8] | 217 | -->
|
---|
[577eb27] | 218 | <para>
|
---|
| 219 | Install <application>PHP</application> by running the following commands:
|
---|
| 220 | </para>
|
---|
[db81e4cb] | 221 |
|
---|
[0098ace6] | 222 | <screen revision="sysv"><userinput>./configure --prefix=/usr \
|
---|
[75033b6] | 223 | --sysconfdir=/etc \
|
---|
[5178bbf6] | 224 | --localstatedir=/var \
|
---|
| 225 | --datadir=/usr/share/php \
|
---|
[81b5be3] | 226 | --mandir=/usr/share/man \
|
---|
[5178bbf6] | 227 | --enable-fpm \
|
---|
| 228 | --with-fpm-user=apache \
|
---|
| 229 | --with-fpm-group=apache \
|
---|
[4a93a3c] | 230 | --with-config-file-path=/etc \
|
---|
[75033b6] | 231 | --with-zlib \
|
---|
| 232 | --enable-bcmath \
|
---|
| 233 | --with-bz2 \
|
---|
| 234 | --enable-calendar \
|
---|
| 235 | --enable-dba=shared \
|
---|
| 236 | --with-gdbm \
|
---|
| 237 | --with-gmp \
|
---|
| 238 | --enable-ftp \
|
---|
| 239 | --with-gettext \
|
---|
| 240 | --enable-mbstring \
|
---|
| 241 | --with-readline &&
|
---|
[db81e4cb] | 242 | make</userinput></screen>
|
---|
| 243 |
|
---|
[0098ace6] | 244 | <screen revision="systemd"><userinput>./configure --prefix=/usr \
|
---|
| 245 | --sysconfdir=/etc \
|
---|
| 246 | --localstatedir=/var \
|
---|
| 247 | --datadir=/usr/share/php \
|
---|
| 248 | --mandir=/usr/share/man \
|
---|
| 249 | --enable-fpm \
|
---|
| 250 | --with-fpm-user=apache \
|
---|
| 251 | --with-fpm-group=apache \
|
---|
| 252 | --with-fpm-systemd \
|
---|
| 253 | --with-config-file-path=/etc \
|
---|
| 254 | --with-zlib \
|
---|
| 255 | --enable-bcmath \
|
---|
| 256 | --with-bz2 \
|
---|
| 257 | --enable-calendar \
|
---|
| 258 | --enable-dba=shared \
|
---|
| 259 | --with-gdbm \
|
---|
| 260 | --with-gmp \
|
---|
| 261 | --enable-ftp \
|
---|
| 262 | --with-gettext \
|
---|
| 263 | --enable-mbstring \
|
---|
| 264 | --with-readline &&
|
---|
| 265 | make</userinput></screen>
|
---|
[577eb27] | 266 | <para>
|
---|
| 267 | To test the results, issue: <command>make test</command>. A few
|
---|
| 268 | tests may fail, in which case you are asked whether you want to send
|
---|
[6dce48a] | 269 | the report to the PHP developers. If you want to automate the test,
|
---|
[577eb27] | 270 | you may prefix the command with <command>yes "n" | </command>.
|
---|
| 271 | </para>
|
---|
[d6f7e6cb] | 272 |
|
---|
[577eb27] | 273 | <para>
|
---|
| 274 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 275 | </para>
|
---|
[db81e4cb] | 276 |
|
---|
[81b5be3] | 277 | <!-- dev note: make INSTALL_ROOT=<DESTDIR> install -->
|
---|
| 278 |
|
---|
[595e58e] | 279 | <screen role="root"><userinput>make install &&
|
---|
| 280 | install -v -m644 php.ini-production /etc/php.ini &&
|
---|
[d6f7e6cb] | 281 |
|
---|
[ba1a38b] | 282 | install -v -m755 -d /usr/share/doc/php-&php-version; &&
|
---|
[75033b6] | 283 | install -v -m644 CODING_STANDARDS EXTENSIONS INSTALL NEWS README* UPGRADING* php.gif \
|
---|
[5a464e4d] | 284 | /usr/share/doc/php-&php-version; &&
|
---|
| 285 | ln -v -sfn /usr/lib/php/doc/Archive_Tar/docs/Archive_Tar.txt \
|
---|
| 286 | /usr/share/doc/php-&php-version; &&
|
---|
| 287 | ln -v -sfn /usr/lib/php/doc/Structures_Graph/docs \
|
---|
| 288 | /usr/share/doc/php-&php-version;</userinput></screen>
|
---|
[db81e4cb] | 289 |
|
---|
[6ca1b179] | 290 | <para>
|
---|
| 291 | The default configuration files for the fastCGI process manager are
|
---|
| 292 | installed only if they do not already exist on the sytem. If this is
|
---|
| 293 | the first installation, they should be renamed, as the
|
---|
| 294 | <systemitem class='username'>root</systemitem> user:
|
---|
| 295 | </para>
|
---|
| 296 |
|
---|
| 297 | <screen role="root"><userinput>if [ -f /etc/php-fpm.conf.default ]; then
|
---|
| 298 | mv -v /etc/php-fpm.conf{.default,} &&
|
---|
| 299 | mv -v /etc/php-fpm.d/www.conf{.default,}
|
---|
| 300 | fi</userinput></screen>
|
---|
| 301 |
|
---|
[577eb27] | 302 | <para>
|
---|
| 303 | The pre-built HTML documentation is packaged in two forms: a tarball
|
---|
| 304 | containing many individual files, useful for quick loading into your
|
---|
| 305 | browser, and one large individual file, which is useful for using the
|
---|
| 306 | search utility of your browser. If you downloaded either, or both, of the
|
---|
| 307 | documentation files, issue the following commands as the
|
---|
| 308 | <systemitem class='username'>root</systemitem> user to install them (note
|
---|
| 309 | these instructions assume English docs, modify the tarball names below if
|
---|
| 310 | necessary).
|
---|
| 311 | </para>
|
---|
[db81e4cb] | 312 |
|
---|
[577eb27] | 313 | <para>
|
---|
| 314 | For the <quote>Single HTML</quote> file:
|
---|
| 315 | </para>
|
---|
[b84326b7] | 316 |
|
---|
| 317 | <screen role="root"><userinput>install -v -m644 ../php_manual_en.html.gz \
|
---|
| 318 | /usr/share/doc/php-&php-version; &&
|
---|
| 319 | gunzip -v /usr/share/doc/php-&php-version;/php_manual_en.html.gz</userinput></screen>
|
---|
| 320 |
|
---|
[577eb27] | 321 | <para>
|
---|
| 322 | For the <quote>Many HTML files</quote> tarball:
|
---|
| 323 | </para>
|
---|
[b84326b7] | 324 |
|
---|
[0fb9d5f] | 325 | <screen role="root"><userinput>tar -xvf ../php_manual_en.tar.gz \
|
---|
[a5db8d2] | 326 | -C /usr/share/doc/php-&php-version; --no-same-owner</userinput></screen>
|
---|
[db81e4cb] | 327 |
|
---|
| 328 | </sect2>
|
---|
[b84326b7] | 329 |
|
---|
[934c9b26] | 330 | <sect2 role="commands">
|
---|
[577eb27] | 331 | <title>Command Explanations</title>
|
---|
[db81e4cb] | 332 |
|
---|
[0098ace6] | 333 | <para revision="systemd">
|
---|
| 334 | <command>sed -i "s|lsystemd-daemon|lsystemd|g" configure</command>:
|
---|
| 335 | This command fixes the detection of the systemd library.
|
---|
| 336 | </para>
|
---|
| 337 |
|
---|
[577eb27] | 338 | <para>
|
---|
[f1d7196] | 339 | <parameter>--datadir=/usr/share/php</parameter>: This works
|
---|
[577eb27] | 340 | around a bug in the build machinery, which installs some data to a
|
---|
| 341 | wrong location.
|
---|
| 342 | </para>
|
---|
[5178bbf6] | 343 |
|
---|
[577eb27] | 344 | <para>
|
---|
| 345 | <parameter>--enable-fpm</parameter>: This parameter allows
|
---|
| 346 | building the fastCGI Process Manager.
|
---|
| 347 | </para>
|
---|
[934c9b26] | 348 |
|
---|
[0098ace6] | 349 | <para revision="systemd">
|
---|
| 350 | <parameter>--with-fpm-systemd</parameter>: This parameter allows
|
---|
| 351 | the FastCGI Process Manager to integrate with systemd.
|
---|
| 352 | </para>
|
---|
| 353 |
|
---|
[577eb27] | 354 | <para>
|
---|
| 355 | <parameter>--with-config-file-path=/etc</parameter>: This parameter
|
---|
| 356 | makes <application>PHP</application> look for the
|
---|
| 357 | <filename>php.ini</filename> configuration file in
|
---|
| 358 | <filename class='directory'>/etc</filename>.
|
---|
| 359 | </para>
|
---|
[934c9b26] | 360 |
|
---|
[577eb27] | 361 | <para>
|
---|
| 362 | <parameter>--with-zlib</parameter>: This parameter adds
|
---|
| 363 | support for <application>Zlib</application> compression.
|
---|
| 364 | </para>
|
---|
[934c9b26] | 365 |
|
---|
[577eb27] | 366 | <para>
|
---|
| 367 | <parameter>--enable-bcmath</parameter>: Enables
|
---|
| 368 | <command>bc</command> style precision math functions.
|
---|
| 369 | </para>
|
---|
[bccbdaea] | 370 |
|
---|
[577eb27] | 371 | <para>
|
---|
| 372 | <parameter>--with-bz2</parameter>: Adds support for
|
---|
| 373 | <application>Bzip2</application> compression functions.
|
---|
| 374 | </para>
|
---|
[934c9b26] | 375 |
|
---|
[577eb27] | 376 | <para>
|
---|
| 377 | <parameter>--enable-calendar</parameter>: This parameter
|
---|
| 378 | provides support for calendar conversion.
|
---|
| 379 | </para>
|
---|
[934c9b26] | 380 |
|
---|
[577eb27] | 381 | <para>
|
---|
| 382 | <parameter>--enable-dba=shared</parameter>: This parameter enables
|
---|
| 383 | support for database (dbm-style) abstraction layer functions.
|
---|
| 384 | </para>
|
---|
[934c9b26] | 385 |
|
---|
[577eb27] | 386 | <para>
|
---|
| 387 | <parameter>--enable-ftp</parameter>: This parameter
|
---|
| 388 | enables FTP functions.
|
---|
| 389 | </para>
|
---|
[934c9b26] | 390 |
|
---|
[577eb27] | 391 | <para>
|
---|
| 392 | <parameter>--with-gettext</parameter>: Enables functions
|
---|
| 393 | that use <application>Gettext</application> text translation.
|
---|
| 394 | </para>
|
---|
[934c9b26] | 395 |
|
---|
[577eb27] | 396 | <para>
|
---|
| 397 | <parameter>--enable-mbstring</parameter>: This parameter
|
---|
| 398 | enables multibyte string support.
|
---|
| 399 | </para>
|
---|
[934c9b26] | 400 |
|
---|
[577eb27] | 401 | <para>
|
---|
| 402 | <parameter>--with-readline</parameter>: This parameter
|
---|
| 403 | enables command line <application>Readline</application> support.
|
---|
| 404 | </para>
|
---|
[934c9b26] | 405 |
|
---|
[577eb27] | 406 | <para>
|
---|
| 407 | <option>--disable-libxml</option>: This option
|
---|
| 408 | allows building PHP without <application>libxml2</application>
|
---|
| 409 | installed.
|
---|
| 410 | </para>
|
---|
[934c9b26] | 411 |
|
---|
[577eb27] | 412 | <para>
|
---|
| 413 | <option>--with-apxs2</option>: Instead of building the fastCGI process
|
---|
| 414 | manager, it is possible to build an <application>apache</application>
|
---|
| 415 | module. This has some performance penalty for heavy loaded servers,
|
---|
| 416 | but may be easier to set up. This switch is incompatible with the
|
---|
| 417 | <parameter>--enable-fpm</parameter> and
|
---|
| 418 | <parameter>--with-fpm-...</parameter> switches.
|
---|
| 419 | </para>
|
---|
[5178bbf6] | 420 |
|
---|
[39ffbd0] | 421 | <para>
|
---|
[b8efb1fb] | 422 | <option>--with-mysqli=shared</option>: This option includes MySQLi
|
---|
| 423 | support.
|
---|
[39ffbd0] | 424 | </para>
|
---|
| 425 |
|
---|
| 426 | <para>
|
---|
| 427 | <option>--with-mysql-sock=/run/mysqld/mysqld.sock</option>: Location of
|
---|
| 428 | the MySQL unix socket pointer.
|
---|
| 429 | </para>
|
---|
| 430 |
|
---|
| 431 | <para>
|
---|
[b8efb1fb] | 432 | <option>--with-pdo-mysql=shared</option>: This option includes PDO:
|
---|
| 433 | MySQL support.
|
---|
| 434 | </para>
|
---|
| 435 |
|
---|
| 436 | <para>
|
---|
| 437 | <option>--with-tidy=shared</option>: This option includes tidy library
|
---|
[39ffbd0] | 438 | support.
|
---|
| 439 | </para>
|
---|
| 440 |
|
---|
[934c9b26] | 441 | </sect2>
|
---|
[bccbdaea] | 442 |
|
---|
[db81e4cb] | 443 | <sect2 role="configuration">
|
---|
| 444 | <title>Configuring PHP</title>
|
---|
| 445 |
|
---|
| 446 | <sect3 id="php-config">
|
---|
| 447 | <title>Config Files</title>
|
---|
| 448 |
|
---|
[577eb27] | 449 | <para>
|
---|
| 450 | <filename>/etc/php.ini</filename>,
|
---|
[8f64429] | 451 | <filename>/etc/pear.conf</filename>,
|
---|
| 452 | <filename>/etc/php-fpm.conf</filename>, and
|
---|
| 453 | <filename>/etc/php-fpm.d/www.conf</filename>
|
---|
[577eb27] | 454 | </para>
|
---|
[db81e4cb] | 455 |
|
---|
| 456 | <indexterm zone="php php-config">
|
---|
| 457 | <primary sortas="e-etc-php.ini">/etc/php.ini</primary>
|
---|
| 458 | </indexterm>
|
---|
| 459 |
|
---|
| 460 | <indexterm zone="php php-config">
|
---|
| 461 | <primary sortas="e-etc-pear.conf">/etc/pear.conf</primary>
|
---|
| 462 | </indexterm>
|
---|
| 463 |
|
---|
[8f64429] | 464 | <indexterm zone="php php-config">
|
---|
| 465 | <primary sortas="e-etc-php-fpm.d-www.conf">
|
---|
| 466 | /etc/php-fpm.d/www.conf</primary>
|
---|
| 467 | </indexterm>
|
---|
| 468 |
|
---|
[5178bbf6] | 469 | <indexterm zone="php php-config">
|
---|
| 470 | <primary sortas="e-etc-php-fpm.conf">/etc/php-fpm.conf</primary>
|
---|
| 471 | </indexterm>
|
---|
| 472 |
|
---|
[db81e4cb] | 473 | </sect3>
|
---|
| 474 |
|
---|
| 475 | <sect3>
|
---|
| 476 | <title>Configuration Information</title>
|
---|
| 477 |
|
---|
[577eb27] | 478 | <para>
|
---|
| 479 | The file used as the default <filename>/etc/php.ini</filename>
|
---|
| 480 | configuration file is recommended by the <application>PHP</application>
|
---|
| 481 | development team. This file modifies the default behavior of
|
---|
| 482 | <application>PHP</application>. If no <filename>/etc/php.ini</filename>
|
---|
| 483 | is used, all configuration settings fall to the defaults. You should
|
---|
| 484 | review the comments in this file and ensure the changes are acceptable
|
---|
| 485 | in your particular environment.
|
---|
| 486 | </para>
|
---|
[e797436] | 487 |
|
---|
[355b8a9] | 488 | <para>
|
---|
| 489 | The fastCGI process manager uses the configuration file
|
---|
| 490 | <filename>/etc/php-fpm.conf</filename>. The default file shipped with
|
---|
| 491 | PHP includes all the <filename>/etc/php-fpm.d/*.conf</filename> in turn.
|
---|
| 492 | There is a shipped <filename>/etc/php-fpm.d/www.conf</filename> file,
|
---|
| 493 | that contains the parameters related to the interaction with the Apache
|
---|
| 494 | Web server.
|
---|
| 495 | </para>
|
---|
| 496 |
|
---|
[577eb27] | 497 | <para>
|
---|
| 498 | You may have noticed the following from the output of the
|
---|
| 499 | <command>make install</command> command:
|
---|
| 500 | </para>
|
---|
[b84326b7] | 501 |
|
---|
[7c1d541] | 502 | <screen><computeroutput>You may want to add: /usr/lib/php to your php.ini include_path</computeroutput></screen>
|
---|
[b84326b7] | 503 |
|
---|
[577eb27] | 504 | <para>
|
---|
| 505 | If desired, add the entry using the following command as the
|
---|
| 506 | <systemitem class="username">root</systemitem> user:
|
---|
| 507 | </para>
|
---|
[b84326b7] | 508 |
|
---|
[7c1d541] | 509 | <screen role="root"><userinput>sed -i 's@php/includes"@&\ninclude_path = ".:/usr/lib/php"@' \
|
---|
[b84326b7] | 510 | /etc/php.ini</userinput></screen>
|
---|
| 511 |
|
---|
[577eb27] | 512 | <para>
|
---|
| 513 | To enable fastCGI support in the <application>Apache</application>
|
---|
| 514 | web server, two LoadModule directives must be added to the
|
---|
| 515 | <filename>httpd.conf</filename> file. They are commented out, so just
|
---|
| 516 | issue the following command as
|
---|
| 517 | <systemitem class="username">root</systemitem> user:
|
---|
| 518 | </para>
|
---|
[db81e4cb] | 519 |
|
---|
[5178bbf6] | 520 | <screen role="root"><userinput>sed -i -e '/proxy_module/s/^#//' \
|
---|
[7f8868f] | 521 | -e '/proxy_fcgi_module/s/^#//' \
|
---|
[5178bbf6] | 522 | /etc/httpd/httpd.conf</userinput></screen>
|
---|
[db81e4cb] | 523 |
|
---|
[577eb27] | 524 | <para>
|
---|
| 525 | Those modules accept various <command>ProxyPass</command>
|
---|
| 526 | directives. One possibility is (as the
|
---|
| 527 | <systemitem class="username">root</systemitem> user):
|
---|
| 528 | </para>
|
---|
[5178bbf6] | 529 |
|
---|
| 530 | <screen role="root"><userinput>echo \
|
---|
[7f8868f] | 531 | 'ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/srv/www/$1' >> \
|
---|
[5178bbf6] | 532 | /etc/httpd/httpd.conf</userinput></screen>
|
---|
| 533 |
|
---|
[577eb27] | 534 | <para>
|
---|
| 535 | Additionally, it may be useful to add an entry for
|
---|
| 536 | <filename>index.php</filename> to the DirectoryIndex directive of the
|
---|
| 537 | <filename>httpd.conf</filename> file. Lastly, adding a line to setup the
|
---|
| 538 | <filename class='extension'>.phps</filename> extension to show
|
---|
| 539 | highlighted <application>PHP</application> source may be
|
---|
| 540 | desirable:
|
---|
| 541 | </para>
|
---|
[e797436] | 542 |
|
---|
| 543 | <screen><literal>AddType application/x-httpd-php-source .phps</literal></screen>
|
---|
[db81e4cb] | 544 |
|
---|
[577eb27] | 545 | <para>
|
---|
| 546 | You'll need to restart the <application>Apache</application> web server
|
---|
| 547 | after making any modifications to the <filename>httpd.conf</filename>
|
---|
| 548 | file.
|
---|
| 549 | </para>
|
---|
[db81e4cb] | 550 |
|
---|
| 551 | </sect3>
|
---|
| 552 |
|
---|
[5178bbf6] | 553 | <sect3 id="php-init">
|
---|
[0098ace6] | 554 | <title><phrase revision="sysv">Boot Script</phrase>
|
---|
| 555 | <phrase revision="systemd">Systemd Unit</phrase></title>
|
---|
[5178bbf6] | 556 |
|
---|
[3c7bd00] | 557 | <para revision="sysv">
|
---|
[5178bbf6] | 558 | To automatically start the <command>php-fpm</command> daemon when the
|
---|
| 559 | system is rebooted, install the
|
---|
| 560 | <filename>/etc/rc.d/init.d/php</filename> bootscript from the
|
---|
| 561 | <xref linkend="bootscripts"/> package as the
|
---|
| 562 | <systemitem class="username">root</systemitem> user:
|
---|
| 563 | </para>
|
---|
| 564 |
|
---|
[3c7bd00] | 565 | <para revision="systemd">
|
---|
[0098ace6] | 566 | To start the <command>php-fpm</command> daemon at boot,
|
---|
| 567 | install the systemd unit from the <xref linkend="systemd-units"/>
|
---|
| 568 | package by running the following command as the
|
---|
[3c7bd00] | 569 | <systemitem class="username">root</systemitem> user:
|
---|
| 570 | </para>
|
---|
| 571 |
|
---|
| 572 |
|
---|
[5178bbf6] | 573 | <indexterm zone="php php-init">
|
---|
| 574 | <primary sortas="f-php">php</primary>
|
---|
| 575 | </indexterm>
|
---|
| 576 |
|
---|
[3c7bd00] | 577 | <screen role="root" revision="sysv"><userinput>make install-php</userinput></screen>
|
---|
| 578 |
|
---|
| 579 | <screen role="root" revision="systemd"><userinput>make install-php-fpm</userinput></screen>
|
---|
| 580 |
|
---|
[5178bbf6] | 581 | </sect3>
|
---|
| 582 |
|
---|
[db81e4cb] | 583 | </sect2>
|
---|
| 584 |
|
---|
| 585 | <sect2 role="content">
|
---|
| 586 | <title>Contents</title>
|
---|
| 587 |
|
---|
| 588 | <segmentedlist>
|
---|
| 589 | <segtitle>Installed Programs</segtitle>
|
---|
[1c345ed] | 590 | <segtitle>Installed Libraries</segtitle>
|
---|
[db81e4cb] | 591 | <segtitle>Installed Directories</segtitle>
|
---|
| 592 |
|
---|
| 593 | <seglistitem>
|
---|
[8f64429] | 594 | <seg>pear, peardev, pecl, phar (symlink), phar.phar, php,
|
---|
| 595 | php-cgi, php-config, php-fpm, phpdbg, and phpize</seg>
|
---|
[17f72f6] | 596 |
|
---|
| 597 | <seg>dba.{so,a} and opcache.{so,a} in
|
---|
[8f64429] | 598 | /usr/lib/php/extensions/no-debug-non-zts-20151012</seg>
|
---|
[17f72f6] | 599 |
|
---|
[8f64429] | 600 | <seg>/etc/php-fpm.d, /usr/{include,lib,share}/php and
|
---|
[ba1a38b] | 601 | /usr/share/doc/php-&php-version;</seg>
|
---|
[db81e4cb] | 602 | </seglistitem>
|
---|
| 603 | </segmentedlist>
|
---|
| 604 |
|
---|
| 605 | <variablelist>
|
---|
| 606 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 607 | <?dbfo list-presentation="list"?>
|
---|
| 608 | <?dbhtml list-presentation="table"?>
|
---|
| 609 |
|
---|
| 610 | <varlistentry id="php-prog">
|
---|
| 611 | <term><command>php</command></term>
|
---|
| 612 | <listitem>
|
---|
[577eb27] | 613 | <para>
|
---|
| 614 | is a command line interface that enables you to parse and
|
---|
| 615 | execute PHP code.
|
---|
| 616 | </para>
|
---|
[db81e4cb] | 617 | <indexterm zone="php php-prog">
|
---|
| 618 | <primary sortas="b-php">php</primary>
|
---|
| 619 | </indexterm>
|
---|
| 620 | </listitem>
|
---|
| 621 | </varlistentry>
|
---|
| 622 |
|
---|
| 623 | <varlistentry id="pear">
|
---|
| 624 | <term><command>pear</command></term>
|
---|
| 625 | <listitem>
|
---|
[577eb27] | 626 | <para>
|
---|
| 627 | is the PHP Extension and Application Repository (PEAR) package
|
---|
| 628 | manager.
|
---|
| 629 | </para>
|
---|
[db81e4cb] | 630 | <indexterm zone="php pear">
|
---|
| 631 | <primary sortas="b-pear">pear</primary>
|
---|
| 632 | </indexterm>
|
---|
| 633 | </listitem>
|
---|
| 634 | </varlistentry>
|
---|
| 635 |
|
---|
[5178bbf6] | 636 | <varlistentry id="php-fpm">
|
---|
| 637 | <term><command>php-fpm</command></term>
|
---|
| 638 | <listitem>
|
---|
[577eb27] | 639 | <para>
|
---|
| 640 | is the fastCGI process manager for PHP.
|
---|
| 641 | </para>
|
---|
[5178bbf6] | 642 | <indexterm zone="php php-fpm">
|
---|
| 643 | <primary sortas="b-php-fpm">php-fpm</primary>
|
---|
| 644 | </indexterm>
|
---|
| 645 | </listitem>
|
---|
| 646 | </varlistentry>
|
---|
| 647 |
|
---|
[8f64429] | 648 | <varlistentry id="phpdbg">
|
---|
| 649 | <term><command>phpdbg</command></term>
|
---|
| 650 | <listitem>
|
---|
| 651 | <para>
|
---|
| 652 | is the interactive PHP debugger.
|
---|
| 653 | </para>
|
---|
| 654 | <indexterm zone="php phpdbg">
|
---|
| 655 | <primary sortas="b-phpdbg">phpdbg</primary>
|
---|
| 656 | </indexterm>
|
---|
| 657 | </listitem>
|
---|
| 658 | </varlistentry>
|
---|
| 659 |
|
---|
[db81e4cb] | 660 | </variablelist>
|
---|
| 661 |
|
---|
| 662 | </sect2>
|
---|
[f45b1953] | 663 |
|
---|
| 664 | </sect1>
|
---|