[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 |
|
---|
[a80b980] | 7 | <!ENTITY php-download-http "http://www.php.net/distributions/php-&php-version;.tar.xz">
|
---|
[2037ec4] | 8 | <!--<!ENTITY php-download-ftp "ftp://ftp.isu.edu.tw/pub/Unix/Web/PHP/distributions/php-&php-version;.tar.xz">-->
|
---|
| 9 | <!ENTITY php-download-ftp " ">
|
---|
[40f85060] | 10 | <!ENTITY php-md5sum "3c5d2b5b392b78fa92c48822e25ccb56">
|
---|
[2037ec4] | 11 | <!ENTITY php-size "11 MB">
|
---|
[40f85060] | 12 | <!ENTITY php-buildsize "565 MB (with the tests). Documentation adds 100 MB">
|
---|
| 13 | <!ENTITY php-time "6.2 SBU (with the tests)">
|
---|
[08254fc] | 14 | ]>
|
---|
| 15 |
|
---|
[6683a00] | 16 | <sect1 id="php" xreflabel="PHP-&php-version;">
|
---|
[db81e4cb] | 17 | <?dbhtml filename="php.html"?>
|
---|
| 18 |
|
---|
| 19 | <sect1info>
|
---|
| 20 | <othername>$LastChangedBy$</othername>
|
---|
| 21 | <date>$Date$</date>
|
---|
| 22 | </sect1info>
|
---|
| 23 |
|
---|
| 24 | <title>PHP-&php-version;</title>
|
---|
| 25 |
|
---|
| 26 | <indexterm zone="php">
|
---|
| 27 | <primary sortas="a-PHP">PHP</primary>
|
---|
| 28 | </indexterm>
|
---|
| 29 |
|
---|
| 30 | <sect2 role="package">
|
---|
| 31 | <title>Introduction to PHP</title>
|
---|
| 32 |
|
---|
[ac38e9dc] | 33 | <para>
|
---|
| 34 | <application>PHP</application> is the PHP Hypertext Preprocessor.
|
---|
| 35 | Primarily used in dynamic web sites, it allows for programming code to be
|
---|
| 36 | directly embedded into the HTML markup. It is also useful as a
|
---|
| 37 | general purpose scripting language.
|
---|
| 38 | </para>
|
---|
[a5db8d2] | 39 |
|
---|
[cf193634] | 40 | &lfs78_checked;
|
---|
[db81e4cb] | 41 |
|
---|
| 42 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 43 | <itemizedlist spacing="compact">
|
---|
| 44 | <listitem>
|
---|
[ac38e9dc] | 45 | <para>
|
---|
| 46 | Download (HTTP): <ulink url="&php-download-http;"/>
|
---|
| 47 | </para>
|
---|
[db81e4cb] | 48 | </listitem>
|
---|
| 49 | <listitem>
|
---|
[ac38e9dc] | 50 | <para>
|
---|
| 51 | Download (FTP): <ulink url="&php-download-ftp;"/>
|
---|
| 52 | </para>
|
---|
[db81e4cb] | 53 | </listitem>
|
---|
| 54 | <listitem>
|
---|
[ac38e9dc] | 55 | <para>
|
---|
| 56 | Download MD5 sum: &php-md5sum;
|
---|
| 57 | </para>
|
---|
[db81e4cb] | 58 | </listitem>
|
---|
| 59 | <listitem>
|
---|
[ac38e9dc] | 60 | <para>
|
---|
| 61 | Download size: &php-size;
|
---|
| 62 | </para>
|
---|
[db81e4cb] | 63 | </listitem>
|
---|
| 64 | <listitem>
|
---|
[ac38e9dc] | 65 | <para>
|
---|
| 66 | Estimated disk space required: &php-buildsize;
|
---|
| 67 | </para>
|
---|
[db81e4cb] | 68 | </listitem>
|
---|
| 69 | <listitem>
|
---|
[ac38e9dc] | 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>
|
---|
[ac38e9dc] | 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>
|
---|
[ac38e9dc] | 95 | <para role="optional">
|
---|
| 96 | <xref linkend="aspell"/>,
|
---|
| 97 | <xref linkend="enchant"/>,
|
---|
[7ff0948] | 98 | <xref linkend="libxslt"/>,
|
---|
[2037ec4] | 99 | an <xref linkend="server-mail"/> (that provides a
|
---|
| 100 | <command>sendmail</command> command),
|
---|
[7ff0948] | 101 | <xref linkend="pcre"/>,
|
---|
[ac38e9dc] | 102 | <xref linkend="pth"/>,
|
---|
[7ff0948] | 103 | <ulink url="http://dmalloc.com/">Dmalloc</ulink>,
|
---|
[ac38e9dc] | 104 | <ulink url="http://www.net-snmp.org/">Net-SNMP</ulink>,
|
---|
[7ff0948] | 105 | <ulink url="http://www.ossp.org/pkg/lib/mm/">OSSP mm</ulink>,
|
---|
[2037ec4] | 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>
|
---|
[ac38e9dc] | 108 | </para>
|
---|
[b84326b7] | 109 |
|
---|
| 110 | <bridgehead renderas="sect4">Optional Graphics Utilities and Libraries</bridgehead>
|
---|
[ac38e9dc] | 111 | <para role="optional">
|
---|
[7ff0948] | 112 | <xref linkend="freetype2"/>,
|
---|
| 113 | <xref linkend="libexif"/>,
|
---|
[ac38e9dc] | 114 | <xref linkend="libjpeg"/>,
|
---|
| 115 | <xref linkend="libpng"/>,
|
---|
[7ff0948] | 116 | <xref linkend="libtiff"/>,
|
---|
[ac38e9dc] | 117 | <xref linkend="x-window-system"/>,
|
---|
[2f034e7] | 118 | <!--<ulink url="http://www.fastio.com/">ClibPDF</ulink>, - site asks for username/password-->
|
---|
[7ff0948] | 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
|
---|
| 121 | <ulink url="http://fossies.org/linux/misc/t1lib-5.1.2.tar.gz/">t1lib</ulink>
|
---|
[ac38e9dc] | 122 | </para>
|
---|
[b84326b7] | 123 |
|
---|
| 124 | <bridgehead renderas="sect4">Optional Web Utilities</bridgehead>
|
---|
[ac38e9dc] | 125 | <para role="optional">
|
---|
| 126 | <xref linkend="curl"/>,
|
---|
[d6e4445] | 127 | <xref linkend="tidy-html"/>,
|
---|
[7ff0948] | 128 | <ulink url="http://sourceforge.net/projects/caudium/">Caudium</ulink>,
|
---|
[40f85060] | 129 | <ulink url="https://www.hyperwave.com/en/">Hyperwave</ulink>,
|
---|
[7ff0948] | 130 | <ulink url="http://www.mnogosearch.org/">mnoGoSearch</ulink>,
|
---|
| 131 | <ulink url="http://www.roxen.com/products/webserver/">Roxen WebServer</ulink>, and
|
---|
[ac38e9dc] | 132 | <ulink url="https://wddxnet.codeplex.com/">WDDX</ulink>
|
---|
| 133 | </para>
|
---|
[b84326b7] | 134 |
|
---|
| 135 | <bridgehead renderas="sect4">Optional Data Management Utilities and Libraries</bridgehead>
|
---|
[ac38e9dc] | 136 | <para role="optional">
|
---|
[8964c2f] | 137 | <xref linkend="db"/> (Note that PHP does not officially support versions
|
---|
| 138 | above 5.3),
|
---|
[ac38e9dc] | 139 | <xref linkend="mariadb"/> or <ulink url="http://www.mysql.com/">MySQL</ulink>,
|
---|
[7ff0948] | 140 | <xref linkend="openldap"/>,
|
---|
[ac38e9dc] | 141 | <xref linkend="postgresql"/>,
|
---|
| 142 | <xref linkend="sqlite"/>,
|
---|
[7ff0948] | 143 | <xref linkend="unixodbc"/>,
|
---|
[2037ec4] | 144 | <ulink url="http://www.softwareag.com/">Adabas</ulink>,
|
---|
[ac38e9dc] | 145 | <ulink url="http://www.birdstep.com/">Birdstep</ulink>,
|
---|
[7ff0948] | 146 | <ulink url="http://cr.yp.to/cdb.html">cdb</ulink>,
|
---|
[ac38e9dc] | 147 | <ulink url="http://www.dbmaker.com/">DBMaker</ulink>,
|
---|
[7ff0948] | 148 | <ulink url="http://www.empress.com/">Empress</ulink>,
|
---|
[2f034e7] | 149 | <ulink url="http://www.frontbase.com/cgi-bin/WebObjects/FBWebSite">FrontBase</ulink>,
|
---|
[7ff0948] | 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>
|
---|
[ac38e9dc] | 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>
|
---|
[ac38e9dc] | 163 | <para role="optional">
|
---|
[2037ec4] | 164 | <xref linkend="openssl"/>,
|
---|
[ac38e9dc] | 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 |
|
---|
[ac38e9dc] | 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 |
|
---|
[ac38e9dc] | 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>
|
---|
[ac38e9dc] | 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
|
---|
[602332ff] | 197 | url="&sources-anduin-http;/files/php_configure.txt"/>.
|
---|
[e797436] | 198 | </para>
|
---|
[3f87e4a] | 199 |
|
---|
[ac38e9dc] | 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>
|
---|
| 208 |
|
---|
[2f034e7] | 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 |
|
---|
| 217 | <screen><userinput>sed -i 's/buffio.h/tidy&/' ext/tidy/*.c</userinput></screen>
|
---|
| 218 |
|
---|
[ac38e9dc] | 219 | <para>
|
---|
| 220 | Install <application>PHP</application> by running the following commands:
|
---|
| 221 | </para>
|
---|
| 222 |
|
---|
| 223 | <screen><userinput>sed -i "s|lsystemd-daemon|lsystemd|g" configure &&
|
---|
[db81e4cb] | 224 |
|
---|
[ac38e9dc] | 225 | ./configure --prefix=/usr \
|
---|
[75033b6] | 226 | --sysconfdir=/etc \
|
---|
[5178bbf6] | 227 | --localstatedir=/var \
|
---|
| 228 | --datadir=/usr/share/php \
|
---|
[81b5be3] | 229 | --mandir=/usr/share/man \
|
---|
[5178bbf6] | 230 | --enable-fpm \
|
---|
| 231 | --with-fpm-user=apache \
|
---|
| 232 | --with-fpm-group=apache \
|
---|
[ac38e9dc] | 233 | --with-fpm-systemd \
|
---|
[4a93a3c] | 234 | --with-config-file-path=/etc \
|
---|
[75033b6] | 235 | --with-zlib \
|
---|
| 236 | --enable-bcmath \
|
---|
| 237 | --with-bz2 \
|
---|
| 238 | --enable-calendar \
|
---|
| 239 | --enable-dba=shared \
|
---|
| 240 | --with-gdbm \
|
---|
| 241 | --with-gmp \
|
---|
| 242 | --enable-ftp \
|
---|
| 243 | --with-gettext \
|
---|
| 244 | --enable-mbstring \
|
---|
| 245 | --with-readline &&
|
---|
[db81e4cb] | 246 | make</userinput></screen>
|
---|
| 247 |
|
---|
[ac38e9dc] | 248 | <para>
|
---|
| 249 | To test the results, issue: <command>make test</command>. A few
|
---|
| 250 | tests may fail, in which case you are asked whether you want to send
|
---|
| 251 | the report to the PHP developpers. If you want to automate the test,
|
---|
| 252 | you may prefix the command with <command>yes "n" | </command>.
|
---|
| 253 | </para>
|
---|
[d6f7e6cb] | 254 |
|
---|
[ac38e9dc] | 255 | <para>
|
---|
| 256 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 257 | </para>
|
---|
[db81e4cb] | 258 |
|
---|
[81b5be3] | 259 | <!-- dev note: make INSTALL_ROOT=<DESTDIR> install -->
|
---|
| 260 |
|
---|
[75033b6] | 261 | <screen role="root"><userinput>make install &&
|
---|
| 262 | install -v -m644 php.ini-production /etc/php.ini &&
|
---|
[5178bbf6] | 263 | mv -v /etc/php-fpm.conf{.default,} &&
|
---|
[d6f7e6cb] | 264 |
|
---|
[2037ec4] | 265 | install -v -m755 -d /usr/share/doc/php-&php-version; &&
|
---|
| 266 | install -v -m644 CODING_STANDARDS EXTENSIONS INSTALL NEWS README* UPGRADING* php.gif \
|
---|
| 267 | /usr/share/doc/php-&php-version; &&
|
---|
| 268 | ln -v -sfn /usr/lib/php/doc/Archive_Tar/docs/Archive_Tar.txt \
|
---|
| 269 | /usr/share/doc/php-&php-version; &&
|
---|
| 270 | ln -v -sfn /usr/lib/php/doc/Structures_Graph/docs \
|
---|
| 271 | /usr/share/doc/php-&php-version;</userinput></screen>
|
---|
[ac38e9dc] | 272 |
|
---|
| 273 | <para>
|
---|
| 274 | The pre-built HTML documentation is packaged in two forms: a tarball
|
---|
| 275 | containing many individual files, useful for quick loading into your
|
---|
| 276 | browser, and one large individual file, which is useful for using the
|
---|
| 277 | search utility of your browser. If you downloaded either, or both, of the
|
---|
| 278 | documentation files, issue the following commands as the
|
---|
| 279 | <systemitem class='username'>root</systemitem> user to install them (note
|
---|
| 280 | these instructions assume English docs, modify the tarball names below if
|
---|
| 281 | necessary).
|
---|
| 282 | </para>
|
---|
| 283 |
|
---|
| 284 | <para>
|
---|
| 285 | For the <quote>Single HTML</quote> file:
|
---|
| 286 | </para>
|
---|
[b84326b7] | 287 |
|
---|
| 288 | <screen role="root"><userinput>install -v -m644 ../php_manual_en.html.gz \
|
---|
| 289 | /usr/share/doc/php-&php-version; &&
|
---|
| 290 | gunzip -v /usr/share/doc/php-&php-version;/php_manual_en.html.gz</userinput></screen>
|
---|
| 291 |
|
---|
[ac38e9dc] | 292 | <para>
|
---|
| 293 | For the <quote>Many HTML files</quote> tarball:
|
---|
| 294 | </para>
|
---|
[b84326b7] | 295 |
|
---|
[0fb9d5f] | 296 | <screen role="root"><userinput>tar -xvf ../php_manual_en.tar.gz \
|
---|
[a5db8d2] | 297 | -C /usr/share/doc/php-&php-version; --no-same-owner</userinput></screen>
|
---|
[db81e4cb] | 298 |
|
---|
| 299 | </sect2>
|
---|
[b84326b7] | 300 |
|
---|
[934c9b26] | 301 | <sect2 role="commands">
|
---|
[ac38e9dc] | 302 | <title>Command Explanations</title>
|
---|
| 303 |
|
---|
| 304 | <para>
|
---|
| 305 | <command>sed -i "s|lsystemd-daemon|lsystemd|g" configure</command>:
|
---|
| 306 | This command fixes the detection of the systemd library.
|
---|
| 307 | </para>
|
---|
[db81e4cb] | 308 |
|
---|
[ac38e9dc] | 309 | <para>
|
---|
| 310 | <parameter>--with-datadir=/usr/share/php</parameter>: This works
|
---|
| 311 | around a bug in the build machinery, which installs some data to a
|
---|
| 312 | wrong location.
|
---|
| 313 | </para>
|
---|
| 314 |
|
---|
| 315 | <para>
|
---|
| 316 | <parameter>--enable-fpm</parameter>: This parameter allows
|
---|
| 317 | building the fastCGI Process Manager.
|
---|
| 318 | </para>
|
---|
[5178bbf6] | 319 |
|
---|
[ac38e9dc] | 320 | <para>
|
---|
| 321 | <parameter>--with-fpm-systemd</parameter>: This parameter allows
|
---|
| 322 | the FastCGI Process Manager to integrate with systemd.
|
---|
| 323 | </para>
|
---|
[934c9b26] | 324 |
|
---|
[ac38e9dc] | 325 | <para>
|
---|
| 326 | <parameter>--with-config-file-path=/etc</parameter>: This parameter
|
---|
| 327 | makes <application>PHP</application> look for the
|
---|
| 328 | <filename>php.ini</filename> configuration file in
|
---|
| 329 | <filename class="directory">/etc</filename>.
|
---|
| 330 | </para>
|
---|
[934c9b26] | 331 |
|
---|
[ac38e9dc] | 332 | <para>
|
---|
| 333 | <parameter>--with-zlib</parameter>: This parameter adds
|
---|
| 334 | support for <application>Zlib</application> compression.
|
---|
| 335 | </para>
|
---|
[934c9b26] | 336 |
|
---|
[ac38e9dc] | 337 | <para>
|
---|
| 338 | <parameter>--enable-bcmath</parameter>: Enables
|
---|
| 339 | <command>bc</command> style precision math functions.
|
---|
| 340 | </para>
|
---|
[bccbdaea] | 341 |
|
---|
[ac38e9dc] | 342 | <para>
|
---|
| 343 | <parameter>--with-bz2</parameter>: Adds support for
|
---|
| 344 | <application>Bzip2</application> compression functions.
|
---|
| 345 | </para>
|
---|
[934c9b26] | 346 |
|
---|
[ac38e9dc] | 347 | <para>
|
---|
| 348 | <parameter>--enable-calendar</parameter>: This parameter
|
---|
| 349 | provides support for calendar conversion.
|
---|
| 350 | </para>
|
---|
[934c9b26] | 351 |
|
---|
[ac38e9dc] | 352 | <para>
|
---|
| 353 | <parameter>--enable-dba=shared</parameter>: This parameter enables
|
---|
| 354 | support for database (dbm-style) abstraction layer functions.
|
---|
| 355 | </para>
|
---|
[934c9b26] | 356 |
|
---|
[ac38e9dc] | 357 | <para>
|
---|
| 358 | <parameter>--enable-ftp</parameter>: This parameter
|
---|
| 359 | enables FTP functions.
|
---|
| 360 | </para>
|
---|
[934c9b26] | 361 |
|
---|
[ac38e9dc] | 362 | <para>
|
---|
| 363 | <parameter>--with-gettext</parameter>: Enables functions
|
---|
| 364 | that use <application>Gettext</application> text translation.
|
---|
| 365 | </para>
|
---|
[934c9b26] | 366 |
|
---|
[ac38e9dc] | 367 | <para>
|
---|
| 368 | <parameter>--enable-mbstring</parameter>: This parameter
|
---|
| 369 | enables multibyte string support.
|
---|
| 370 | </para>
|
---|
[934c9b26] | 371 |
|
---|
[ac38e9dc] | 372 | <para>
|
---|
| 373 | <parameter>--with-readline</parameter>: This parameter
|
---|
| 374 | enables command line <application>Readline</application> support.
|
---|
| 375 | </para>
|
---|
[934c9b26] | 376 |
|
---|
[ac38e9dc] | 377 | <para>
|
---|
| 378 | <option>--disable-libxml</option>: This option
|
---|
| 379 | allows building PHP without <application>libxml2</application>
|
---|
| 380 | installed.
|
---|
| 381 | </para>
|
---|
[934c9b26] | 382 |
|
---|
[ac38e9dc] | 383 | <para>
|
---|
| 384 | <option>--with-apxs2</option>: Instead of building the fastCGI process
|
---|
| 385 | manager, it is possible to build an <application>apache</application>
|
---|
| 386 | module. This has some performance penalty for heavy loaded servers,
|
---|
| 387 | but may be easier to set up. This switch is incompatible with the
|
---|
| 388 | <parameter>--enable-fpm</parameter> and
|
---|
| 389 | <parameter>--with-fpm-...</parameter> switches.
|
---|
| 390 | </para>
|
---|
[5178bbf6] | 391 |
|
---|
[2037ec4] | 392 | <para>
|
---|
[2f034e7] | 393 | <option>--with-mysqli=shared</option>: This option includes MySQLi
|
---|
| 394 | support.
|
---|
[2037ec4] | 395 | </para>
|
---|
| 396 |
|
---|
| 397 | <para>
|
---|
| 398 | <option>--with-mysql-sock=/run/mysqld/mysqld.sock</option>: Location of
|
---|
| 399 | the MySQL unix socket pointer.
|
---|
| 400 | </para>
|
---|
| 401 |
|
---|
| 402 | <para>
|
---|
[2f034e7] | 403 | <option>--with-pdo-mysql=shared</option>: This option includes PDO:
|
---|
| 404 | MySQL support.
|
---|
| 405 | </para>
|
---|
| 406 |
|
---|
| 407 | <para>
|
---|
| 408 | <option>--with-tidy=shared</option>: This option includes tidy library
|
---|
[2037ec4] | 409 | support.
|
---|
| 410 | </para>
|
---|
| 411 |
|
---|
[934c9b26] | 412 | </sect2>
|
---|
[bccbdaea] | 413 |
|
---|
[db81e4cb] | 414 | <sect2 role="configuration">
|
---|
| 415 | <title>Configuring PHP</title>
|
---|
| 416 |
|
---|
| 417 | <sect3 id="php-config">
|
---|
| 418 | <title>Config Files</title>
|
---|
| 419 |
|
---|
[ac38e9dc] | 420 | <para>
|
---|
| 421 | <filename>/etc/php.ini</filename>,
|
---|
[2037ec4] | 422 | <filename>/etc/pear.conf</filename>,
|
---|
| 423 | <filename>/etc/php-fpm.conf</filename>, and
|
---|
| 424 | <filename>/etc/php-fpm.d/www.conf</filename>
|
---|
[ac38e9dc] | 425 | </para>
|
---|
[db81e4cb] | 426 |
|
---|
| 427 | <indexterm zone="php php-config">
|
---|
| 428 | <primary sortas="e-etc-php.ini">/etc/php.ini</primary>
|
---|
| 429 | </indexterm>
|
---|
| 430 |
|
---|
| 431 | <indexterm zone="php php-config">
|
---|
| 432 | <primary sortas="e-etc-pear.conf">/etc/pear.conf</primary>
|
---|
| 433 | </indexterm>
|
---|
| 434 |
|
---|
[2037ec4] | 435 | <indexterm zone="php php-config">
|
---|
| 436 | <primary sortas="e-etc-php-fpm.d-www.conf">
|
---|
| 437 | /etc/php-fpm.d/www.conf</primary>
|
---|
| 438 | </indexterm>
|
---|
| 439 |
|
---|
[5178bbf6] | 440 | <indexterm zone="php php-config">
|
---|
| 441 | <primary sortas="e-etc-php-fpm.conf">/etc/php-fpm.conf</primary>
|
---|
| 442 | </indexterm>
|
---|
| 443 |
|
---|
[db81e4cb] | 444 | </sect3>
|
---|
| 445 |
|
---|
| 446 | <sect3>
|
---|
| 447 | <title>Configuration Information</title>
|
---|
| 448 |
|
---|
[2037ec4] | 449 | <para>
|
---|
| 450 | Without the file <filename>/etc/php-fpm.d/www.conf</filename>,
|
---|
| 451 | the process manager does not start. However, it is the file
|
---|
| 452 | <filename>/etc/php-fpm.d/www.conf.default</filename>, that is
|
---|
| 453 | installed. To solve this, issue as the
|
---|
| 454 | <systemitem class="username">root</systemitem> user:
|
---|
| 455 | </para>
|
---|
| 456 |
|
---|
| 457 | <screen role="root"><userinput>cp -v /etc/php-fpm.d/www.conf.default /etc/php-fpm.d/www.conf</userinput></screen>
|
---|
| 458 |
|
---|
[ac38e9dc] | 459 | <para>
|
---|
| 460 | The file used as the default <filename>/etc/php.ini</filename>
|
---|
| 461 | configuration file is recommended by the <application>PHP</application>
|
---|
| 462 | development team. This file modifies the default behavior of
|
---|
| 463 | <application>PHP</application>. If no <filename>/etc/php.ini</filename>
|
---|
| 464 | is used, all configuration settings fall to the defaults. You should
|
---|
| 465 | review the comments in this file and ensure the changes are acceptable
|
---|
| 466 | in your particular environment.
|
---|
| 467 | </para>
|
---|
[e797436] | 468 |
|
---|
[ac38e9dc] | 469 | <para>
|
---|
| 470 | You may have noticed the following from the output of the
|
---|
| 471 | <command>make install</command> command:
|
---|
| 472 | </para>
|
---|
[b84326b7] | 473 |
|
---|
[7c1d541] | 474 | <screen><computeroutput>You may want to add: /usr/lib/php to your php.ini include_path</computeroutput></screen>
|
---|
[b84326b7] | 475 |
|
---|
[ac38e9dc] | 476 | <para>
|
---|
| 477 | If desired, add the entry using the following command as the
|
---|
| 478 | <systemitem class="username">root</systemitem> user:
|
---|
| 479 | </para>
|
---|
[b84326b7] | 480 |
|
---|
[7c1d541] | 481 | <screen role="root"><userinput>sed -i 's@php/includes"@&\ninclude_path = ".:/usr/lib/php"@' \
|
---|
[b84326b7] | 482 | /etc/php.ini</userinput></screen>
|
---|
| 483 |
|
---|
[ac38e9dc] | 484 | <para>
|
---|
| 485 | To enable fastCGI support in the <application>Apache</application>
|
---|
| 486 | web server, two LoadModule directives must be added to the
|
---|
| 487 | <filename>httpd.conf</filename> file. They are commented out, so just
|
---|
| 488 | issue the following command as
|
---|
| 489 | <systemitem class="username">root</systemitem> user:
|
---|
| 490 | </para>
|
---|
[db81e4cb] | 491 |
|
---|
[2037ec4] | 492 | <screen role="root"><userinput>sed -i -e '/proxy_module/s/^#//' \
|
---|
| 493 | -e '/proxy_fcgi_module/s/^#//' \
|
---|
| 494 | /etc/httpd/httpd.conf</userinput></screen>
|
---|
[db81e4cb] | 495 |
|
---|
[ac38e9dc] | 496 | <para>
|
---|
| 497 | Those modules accept various <command>ProxyPass</command>
|
---|
| 498 | directives. One possibility is (as the
|
---|
| 499 | <systemitem class="username">root</systemitem> user):
|
---|
| 500 | </para>
|
---|
[5178bbf6] | 501 |
|
---|
[2037ec4] | 502 | <screen role="root"><userinput>echo \
|
---|
| 503 | 'ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/srv/www/$1' >> \
|
---|
| 504 | /etc/httpd/httpd.conf</userinput></screen>
|
---|
[5178bbf6] | 505 |
|
---|
[ac38e9dc] | 506 | <para>
|
---|
| 507 | Additionally, it may be useful to add an entry for
|
---|
| 508 | <filename>index.php</filename> to the DirectoryIndex directive of the
|
---|
| 509 | <filename>httpd.conf</filename> file. Lastly, adding a line to setup the
|
---|
| 510 | <filename class='extension'>.phps</filename> extension to show
|
---|
| 511 | highlighted <application>PHP</application> source may be
|
---|
| 512 | desirable:
|
---|
| 513 | </para>
|
---|
[e797436] | 514 |
|
---|
| 515 | <screen><literal>AddType application/x-httpd-php-source .phps</literal></screen>
|
---|
[db81e4cb] | 516 |
|
---|
[ac38e9dc] | 517 | <para>
|
---|
| 518 | You'll need to restart the <application>Apache</application> web server
|
---|
| 519 | after making any modifications to the <filename>httpd.conf</filename>
|
---|
| 520 | file.
|
---|
| 521 | </para>
|
---|
[db81e4cb] | 522 |
|
---|
| 523 | </sect3>
|
---|
| 524 |
|
---|
[5178bbf6] | 525 | <sect3 id="php-init">
|
---|
[1aab91a] | 526 | <title>Systemd Units</title>
|
---|
[5178bbf6] | 527 |
|
---|
| 528 | <para>
|
---|
[1aab91a] | 529 | To start the <command>php-fpm</command> daemon at boot,
|
---|
| 530 | install the systemd unit from the <xref linkend="bootscripts"/>
|
---|
| 531 | package by running the following command as the
|
---|
[5178bbf6] | 532 | <systemitem class="username">root</systemitem> user:
|
---|
| 533 | </para>
|
---|
| 534 |
|
---|
| 535 | <indexterm zone="php php-init">
|
---|
[1aab91a] | 536 | <primary sortas="f-php-fpm">php-fpm</primary>
|
---|
[5178bbf6] | 537 | </indexterm>
|
---|
| 538 |
|
---|
[1aab91a] | 539 | <screen role="root"><userinput>make install-php-fpm</userinput></screen>
|
---|
[5178bbf6] | 540 | </sect3>
|
---|
| 541 |
|
---|
[db81e4cb] | 542 | </sect2>
|
---|
| 543 |
|
---|
| 544 | <sect2 role="content">
|
---|
| 545 | <title>Contents</title>
|
---|
| 546 |
|
---|
| 547 | <segmentedlist>
|
---|
| 548 | <segtitle>Installed Programs</segtitle>
|
---|
[1c345ed] | 549 | <segtitle>Installed Libraries</segtitle>
|
---|
[db81e4cb] | 550 | <segtitle>Installed Directories</segtitle>
|
---|
| 551 |
|
---|
| 552 | <seglistitem>
|
---|
[2037ec4] | 553 | <seg>pear, peardev, pecl, phar (symlink), phar.phar, php,
|
---|
| 554 | php-cgi, php-config, php-fpm, phpdbg, and phpize</seg>
|
---|
| 555 | <seg>dba.{so,a} and opcache.{so,a} at
|
---|
| 556 | /usr/lib/php/extensions/no-debug-non-zts-20151012</seg>
|
---|
| 557 | <seg>/etc/php-fpm.d, /usr/{include,lib,share}/php and
|
---|
[ba1a38b] | 558 | /usr/share/doc/php-&php-version;</seg>
|
---|
[db81e4cb] | 559 | </seglistitem>
|
---|
| 560 | </segmentedlist>
|
---|
| 561 |
|
---|
| 562 | <variablelist>
|
---|
| 563 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 564 | <?dbfo list-presentation="list"?>
|
---|
| 565 | <?dbhtml list-presentation="table"?>
|
---|
| 566 |
|
---|
| 567 | <varlistentry id="php-prog">
|
---|
| 568 | <term><command>php</command></term>
|
---|
| 569 | <listitem>
|
---|
[ac38e9dc] | 570 | <para>
|
---|
| 571 | is a command line interface that enables you to parse and
|
---|
| 572 | execute PHP code.
|
---|
| 573 | </para>
|
---|
[db81e4cb] | 574 | <indexterm zone="php php-prog">
|
---|
| 575 | <primary sortas="b-php">php</primary>
|
---|
| 576 | </indexterm>
|
---|
| 577 | </listitem>
|
---|
| 578 | </varlistentry>
|
---|
| 579 |
|
---|
| 580 | <varlistentry id="pear">
|
---|
| 581 | <term><command>pear</command></term>
|
---|
| 582 | <listitem>
|
---|
[ac38e9dc] | 583 | <para>
|
---|
| 584 | is the PHP Extension and Application Repository (PEAR) package
|
---|
| 585 | manager.
|
---|
| 586 | </para>
|
---|
[db81e4cb] | 587 | <indexterm zone="php pear">
|
---|
| 588 | <primary sortas="b-pear">pear</primary>
|
---|
| 589 | </indexterm>
|
---|
| 590 | </listitem>
|
---|
| 591 | </varlistentry>
|
---|
| 592 |
|
---|
[5178bbf6] | 593 | <varlistentry id="php-fpm">
|
---|
| 594 | <term><command>php-fpm</command></term>
|
---|
| 595 | <listitem>
|
---|
[ac38e9dc] | 596 | <para>
|
---|
| 597 | is the fastCGI process manager for PHP.
|
---|
| 598 | </para>
|
---|
[5178bbf6] | 599 | <indexterm zone="php php-fpm">
|
---|
| 600 | <primary sortas="b-php-fpm">php-fpm</primary>
|
---|
| 601 | </indexterm>
|
---|
| 602 | </listitem>
|
---|
| 603 | </varlistentry>
|
---|
| 604 |
|
---|
[2037ec4] | 605 | <varlistentry id="phpdbg">
|
---|
| 606 | <term><command>phpdbg</command></term>
|
---|
| 607 | <listitem>
|
---|
| 608 | <para>
|
---|
| 609 | is the interactive PHP debugger.
|
---|
| 610 | </para>
|
---|
| 611 | <indexterm zone="php phpdbg">
|
---|
| 612 | <primary sortas="b-phpdbg">phpdbg</primary>
|
---|
| 613 | </indexterm>
|
---|
| 614 | </listitem>
|
---|
| 615 | </varlistentry>
|
---|
| 616 |
|
---|
[db81e4cb] | 617 | </variablelist>
|
---|
| 618 |
|
---|
| 619 | </sect2>
|
---|
[f45b1953] | 620 |
|
---|
| 621 | </sect1>
|
---|