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