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