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