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