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