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