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