[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 " ">
|
---|
| 10 | <!ENTITY php-md5sum "ce5964672e4ec0b66ff088a6bafde8c7">
|
---|
| 11 | <!ENTITY php-size "11 MB">
|
---|
| 12 | <!ENTITY php-buildsize "564 MB (with the tests). Documentation adds 106 MB">
|
---|
| 13 | <!ENTITY php-time "6.3 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>,
|
---|
[ac38e9dc] | 129 | <ulink url="http://www.hyperwave.com/">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">
|
---|
| 137 | <xref linkend="db"/>,
|
---|
| 138 | <xref linkend="mariadb"/> or <ulink url="http://www.mysql.com/">MySQL</ulink>,
|
---|
[7ff0948] | 139 | <xref linkend="openldap"/>,
|
---|
[ac38e9dc] | 140 | <xref linkend="postgresql"/>,
|
---|
| 141 | <xref linkend="sqlite"/>,
|
---|
[7ff0948] | 142 | <xref linkend="unixodbc"/>,
|
---|
[2037ec4] | 143 | <ulink url="http://www.softwareag.com/">Adabas</ulink>,
|
---|
[ac38e9dc] | 144 | <ulink url="http://www.birdstep.com/">Birdstep</ulink>,
|
---|
[7ff0948] | 145 | <ulink url="http://cr.yp.to/cdb.html">cdb</ulink>,
|
---|
[ac38e9dc] | 146 | <ulink url="http://www.dbmaker.com/">DBMaker</ulink>,
|
---|
[7ff0948] | 147 | <ulink url="http://www.empress.com/">Empress</ulink>,
|
---|
[2f034e7] | 148 | <ulink url="http://www.frontbase.com/cgi-bin/WebObjects/FBWebSite">FrontBase</ulink>,
|
---|
[7ff0948] | 149 | <ulink url="http://www.hughes.com.au/products/msql/">Mini SQL</ulink>,
|
---|
| 150 | <ulink url="http://www.monetra.com/">Monetra</ulink>, and
|
---|
| 151 | <ulink url="http://sourceforge.net/projects/qdbm">QDBM</ulink>
|
---|
[ac38e9dc] | 152 | </para>
|
---|
| 153 |
|
---|
| 154 | <para>
|
---|
| 155 | <application>PHP</application> also provides support for many
|
---|
| 156 | commercial database tools such as <application>Oracle</application>,
|
---|
| 157 | <application>SAP</application> and
|
---|
| 158 | <application>ODBC Router</application>.
|
---|
| 159 | </para>
|
---|
[e797436] | 160 |
|
---|
[b84326b7] | 161 | <bridgehead renderas="sect4">Optional Security/Encryption Utilities and Libraries</bridgehead>
|
---|
[ac38e9dc] | 162 | <para role="optional">
|
---|
[2037ec4] | 163 | <xref linkend="openssl"/>,
|
---|
[ac38e9dc] | 164 | <xref linkend="cyrus-sasl"/>,
|
---|
| 165 | <xref linkend="mitkrb"/>,
|
---|
| 166 | <ulink url="http://mcrypt.sourceforge.net/">libmcrypt</ulink>, and
|
---|
| 167 | <ulink url="http://mhash.sourceforge.net/">mhash</ulink>
|
---|
| 168 | </para>
|
---|
[db81e4cb] | 169 |
|
---|
[ac38e9dc] | 170 | <para condition="html" role="usernotes">
|
---|
| 171 | User Notes: <ulink url="&blfs-wiki;/php"/>
|
---|
| 172 | </para>
|
---|
[1039de3] | 173 |
|
---|
[db81e4cb] | 174 | </sect2>
|
---|
| 175 |
|
---|
| 176 | <sect2 role="installation">
|
---|
| 177 | <title>Installation of PHP</title>
|
---|
| 178 |
|
---|
[ac38e9dc] | 179 | <para>
|
---|
| 180 | You can use <application>PHP</application> for server-side
|
---|
| 181 | scripting, command-line scripting or client-side GUI applications. This
|
---|
| 182 | book provides instructions for setting up <application>PHP</application>
|
---|
| 183 | for server-side scripting as it is the most common form.
|
---|
| 184 | </para>
|
---|
[db81e4cb] | 185 |
|
---|
[b84326b7] | 186 | <note>
|
---|
[ac38e9dc] | 187 | <para>
|
---|
| 188 | <application>PHP</application> has many more
|
---|
| 189 | <command>configure</command> options that will enable support for
|
---|
| 190 | various things. You can use <command>./configure --help</command> to
|
---|
| 191 | see a full list of the available options. Also, use of the
|
---|
| 192 | <ulink url="http://www.php.net/">PHP web site</ulink>
|
---|
| 193 | is highly recommended, as their online docs are very good. An example
|
---|
| 194 | of a <command>configure</command> command that utilizes many of the
|
---|
| 195 | most common dependencies can be found at <ulink
|
---|
[602332ff] | 196 | url="&sources-anduin-http;/files/php_configure.txt"/>.
|
---|
[e797436] | 197 | </para>
|
---|
[3f87e4a] | 198 |
|
---|
[ac38e9dc] | 199 | <para>
|
---|
| 200 | If, for whatever reason, you don't have <xref linkend="libxml2"/>
|
---|
| 201 | installed, you need to add <option>--disable-libxml</option> to the
|
---|
| 202 | <command>configure</command> command in the instructions below. Note
|
---|
| 203 | that this will prevent the <command>pear</command> command from being
|
---|
| 204 | built.
|
---|
| 205 | </para>
|
---|
[b84326b7] | 206 | </note>
|
---|
| 207 |
|
---|
[2f034e7] | 208 | <para>
|
---|
| 209 | If you wish to build <application>PHP</application> with the
|
---|
| 210 | <application>tidy-html5</application> library, due to API changes, in the
|
---|
| 211 | <application>PHP</application> source, <filename>buffio.h</filename>
|
---|
| 212 | header needs to be changed to <filename>tidybuffio.h</filename> in the
|
---|
| 213 | file <filename>ext/tidy/tidy.c</filename>:
|
---|
| 214 | </para>
|
---|
| 215 |
|
---|
| 216 | <screen><userinput>sed -i 's/buffio.h/tidy&/' ext/tidy/*.c</userinput></screen>
|
---|
| 217 |
|
---|
[ac38e9dc] | 218 | <para>
|
---|
| 219 | Install <application>PHP</application> by running the following commands:
|
---|
| 220 | </para>
|
---|
| 221 |
|
---|
| 222 | <screen><userinput>sed -i "s|lsystemd-daemon|lsystemd|g" configure &&
|
---|
[db81e4cb] | 223 |
|
---|
[ac38e9dc] | 224 | ./configure --prefix=/usr \
|
---|
[75033b6] | 225 | --sysconfdir=/etc \
|
---|
[5178bbf6] | 226 | --localstatedir=/var \
|
---|
| 227 | --datadir=/usr/share/php \
|
---|
[81b5be3] | 228 | --mandir=/usr/share/man \
|
---|
[5178bbf6] | 229 | --enable-fpm \
|
---|
| 230 | --with-fpm-user=apache \
|
---|
| 231 | --with-fpm-group=apache \
|
---|
[ac38e9dc] | 232 | --with-fpm-systemd \
|
---|
[4a93a3c] | 233 | --with-config-file-path=/etc \
|
---|
[75033b6] | 234 | --with-zlib \
|
---|
| 235 | --enable-bcmath \
|
---|
| 236 | --with-bz2 \
|
---|
| 237 | --enable-calendar \
|
---|
| 238 | --enable-dba=shared \
|
---|
| 239 | --with-gdbm \
|
---|
| 240 | --with-gmp \
|
---|
| 241 | --enable-ftp \
|
---|
| 242 | --with-gettext \
|
---|
| 243 | --enable-mbstring \
|
---|
| 244 | --with-readline &&
|
---|
[db81e4cb] | 245 | make</userinput></screen>
|
---|
| 246 |
|
---|
[ac38e9dc] | 247 | <para>
|
---|
| 248 | To test the results, issue: <command>make test</command>. A few
|
---|
| 249 | tests may fail, in which case you are asked whether you want to send
|
---|
| 250 | the report to the PHP developpers. If you want to automate the test,
|
---|
| 251 | you may prefix the command with <command>yes "n" | </command>.
|
---|
| 252 | </para>
|
---|
[d6f7e6cb] | 253 |
|
---|
[ac38e9dc] | 254 | <para>
|
---|
| 255 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 256 | </para>
|
---|
[db81e4cb] | 257 |
|
---|
[81b5be3] | 258 | <!-- dev note: make INSTALL_ROOT=<DESTDIR> install -->
|
---|
| 259 |
|
---|
[75033b6] | 260 | <screen role="root"><userinput>make install &&
|
---|
| 261 | install -v -m644 php.ini-production /etc/php.ini &&
|
---|
[5178bbf6] | 262 | mv -v /etc/php-fpm.conf{.default,} &&
|
---|
[d6f7e6cb] | 263 |
|
---|
[2037ec4] | 264 | install -v -m755 -d /usr/share/doc/php-&php-version; &&
|
---|
| 265 | install -v -m644 CODING_STANDARDS EXTENSIONS INSTALL NEWS README* UPGRADING* php.gif \
|
---|
| 266 | /usr/share/doc/php-&php-version; &&
|
---|
| 267 | ln -v -sfn /usr/lib/php/doc/Archive_Tar/docs/Archive_Tar.txt \
|
---|
| 268 | /usr/share/doc/php-&php-version; &&
|
---|
| 269 | ln -v -sfn /usr/lib/php/doc/Structures_Graph/docs \
|
---|
| 270 | /usr/share/doc/php-&php-version;</userinput></screen>
|
---|
[ac38e9dc] | 271 |
|
---|
| 272 | <para>
|
---|
| 273 | The pre-built HTML documentation is packaged in two forms: a tarball
|
---|
| 274 | containing many individual files, useful for quick loading into your
|
---|
| 275 | browser, and one large individual file, which is useful for using the
|
---|
| 276 | search utility of your browser. If you downloaded either, or both, of the
|
---|
| 277 | documentation files, issue the following commands as the
|
---|
| 278 | <systemitem class='username'>root</systemitem> user to install them (note
|
---|
| 279 | these instructions assume English docs, modify the tarball names below if
|
---|
| 280 | necessary).
|
---|
| 281 | </para>
|
---|
| 282 |
|
---|
| 283 | <para>
|
---|
| 284 | For the <quote>Single HTML</quote> file:
|
---|
| 285 | </para>
|
---|
[b84326b7] | 286 |
|
---|
| 287 | <screen role="root"><userinput>install -v -m644 ../php_manual_en.html.gz \
|
---|
| 288 | /usr/share/doc/php-&php-version; &&
|
---|
| 289 | gunzip -v /usr/share/doc/php-&php-version;/php_manual_en.html.gz</userinput></screen>
|
---|
| 290 |
|
---|
[ac38e9dc] | 291 | <para>
|
---|
| 292 | For the <quote>Many HTML files</quote> tarball:
|
---|
| 293 | </para>
|
---|
[b84326b7] | 294 |
|
---|
[0fb9d5f] | 295 | <screen role="root"><userinput>tar -xvf ../php_manual_en.tar.gz \
|
---|
[a5db8d2] | 296 | -C /usr/share/doc/php-&php-version; --no-same-owner</userinput></screen>
|
---|
[db81e4cb] | 297 |
|
---|
| 298 | </sect2>
|
---|
[b84326b7] | 299 |
|
---|
[934c9b26] | 300 | <sect2 role="commands">
|
---|
[ac38e9dc] | 301 | <title>Command Explanations</title>
|
---|
| 302 |
|
---|
| 303 | <para>
|
---|
| 304 | <command>sed -i "s|lsystemd-daemon|lsystemd|g" configure</command>:
|
---|
| 305 | This command fixes the detection of the systemd library.
|
---|
| 306 | </para>
|
---|
[db81e4cb] | 307 |
|
---|
[ac38e9dc] | 308 | <para>
|
---|
| 309 | <parameter>--with-datadir=/usr/share/php</parameter>: This works
|
---|
| 310 | around a bug in the build machinery, which installs some data to a
|
---|
| 311 | wrong location.
|
---|
| 312 | </para>
|
---|
| 313 |
|
---|
| 314 | <para>
|
---|
| 315 | <parameter>--enable-fpm</parameter>: This parameter allows
|
---|
| 316 | building the fastCGI Process Manager.
|
---|
| 317 | </para>
|
---|
[5178bbf6] | 318 |
|
---|
[ac38e9dc] | 319 | <para>
|
---|
| 320 | <parameter>--with-fpm-systemd</parameter>: This parameter allows
|
---|
| 321 | the FastCGI Process Manager to integrate with systemd.
|
---|
| 322 | </para>
|
---|
[934c9b26] | 323 |
|
---|
[ac38e9dc] | 324 | <para>
|
---|
| 325 | <parameter>--with-config-file-path=/etc</parameter>: This parameter
|
---|
| 326 | makes <application>PHP</application> look for the
|
---|
| 327 | <filename>php.ini</filename> configuration file in
|
---|
| 328 | <filename class="directory">/etc</filename>.
|
---|
| 329 | </para>
|
---|
[934c9b26] | 330 |
|
---|
[ac38e9dc] | 331 | <para>
|
---|
| 332 | <parameter>--with-zlib</parameter>: This parameter adds
|
---|
| 333 | support for <application>Zlib</application> compression.
|
---|
| 334 | </para>
|
---|
[934c9b26] | 335 |
|
---|
[ac38e9dc] | 336 | <para>
|
---|
| 337 | <parameter>--enable-bcmath</parameter>: Enables
|
---|
| 338 | <command>bc</command> style precision math functions.
|
---|
| 339 | </para>
|
---|
[bccbdaea] | 340 |
|
---|
[ac38e9dc] | 341 | <para>
|
---|
| 342 | <parameter>--with-bz2</parameter>: Adds support for
|
---|
| 343 | <application>Bzip2</application> compression functions.
|
---|
| 344 | </para>
|
---|
[934c9b26] | 345 |
|
---|
[ac38e9dc] | 346 | <para>
|
---|
| 347 | <parameter>--enable-calendar</parameter>: This parameter
|
---|
| 348 | provides support for calendar conversion.
|
---|
| 349 | </para>
|
---|
[934c9b26] | 350 |
|
---|
[ac38e9dc] | 351 | <para>
|
---|
| 352 | <parameter>--enable-dba=shared</parameter>: This parameter enables
|
---|
| 353 | support for database (dbm-style) abstraction layer functions.
|
---|
| 354 | </para>
|
---|
[934c9b26] | 355 |
|
---|
[ac38e9dc] | 356 | <para>
|
---|
| 357 | <parameter>--enable-ftp</parameter>: This parameter
|
---|
| 358 | enables FTP functions.
|
---|
| 359 | </para>
|
---|
[934c9b26] | 360 |
|
---|
[ac38e9dc] | 361 | <para>
|
---|
| 362 | <parameter>--with-gettext</parameter>: Enables functions
|
---|
| 363 | that use <application>Gettext</application> text translation.
|
---|
| 364 | </para>
|
---|
[934c9b26] | 365 |
|
---|
[ac38e9dc] | 366 | <para>
|
---|
| 367 | <parameter>--enable-mbstring</parameter>: This parameter
|
---|
| 368 | enables multibyte string support.
|
---|
| 369 | </para>
|
---|
[934c9b26] | 370 |
|
---|
[ac38e9dc] | 371 | <para>
|
---|
| 372 | <parameter>--with-readline</parameter>: This parameter
|
---|
| 373 | enables command line <application>Readline</application> support.
|
---|
| 374 | </para>
|
---|
[934c9b26] | 375 |
|
---|
[ac38e9dc] | 376 | <para>
|
---|
| 377 | <option>--disable-libxml</option>: This option
|
---|
| 378 | allows building PHP without <application>libxml2</application>
|
---|
| 379 | installed.
|
---|
| 380 | </para>
|
---|
[934c9b26] | 381 |
|
---|
[ac38e9dc] | 382 | <para>
|
---|
| 383 | <option>--with-apxs2</option>: Instead of building the fastCGI process
|
---|
| 384 | manager, it is possible to build an <application>apache</application>
|
---|
| 385 | module. This has some performance penalty for heavy loaded servers,
|
---|
| 386 | but may be easier to set up. This switch is incompatible with the
|
---|
| 387 | <parameter>--enable-fpm</parameter> and
|
---|
| 388 | <parameter>--with-fpm-...</parameter> switches.
|
---|
| 389 | </para>
|
---|
[5178bbf6] | 390 |
|
---|
[2037ec4] | 391 | <para>
|
---|
[2f034e7] | 392 | <option>--with-mysqli=shared</option>: This option includes MySQLi
|
---|
| 393 | support.
|
---|
[2037ec4] | 394 | </para>
|
---|
| 395 |
|
---|
| 396 | <para>
|
---|
| 397 | <option>--with-mysql-sock=/run/mysqld/mysqld.sock</option>: Location of
|
---|
| 398 | the MySQL unix socket pointer.
|
---|
| 399 | </para>
|
---|
| 400 |
|
---|
| 401 | <para>
|
---|
[2f034e7] | 402 | <option>--with-pdo-mysql=shared</option>: This option includes PDO:
|
---|
| 403 | MySQL support.
|
---|
| 404 | </para>
|
---|
| 405 |
|
---|
| 406 | <para>
|
---|
| 407 | <option>--with-tidy=shared</option>: This option includes tidy library
|
---|
[2037ec4] | 408 | support.
|
---|
| 409 | </para>
|
---|
| 410 |
|
---|
[934c9b26] | 411 | </sect2>
|
---|
[bccbdaea] | 412 |
|
---|
[db81e4cb] | 413 | <sect2 role="configuration">
|
---|
| 414 | <title>Configuring PHP</title>
|
---|
| 415 |
|
---|
| 416 | <sect3 id="php-config">
|
---|
| 417 | <title>Config Files</title>
|
---|
| 418 |
|
---|
[ac38e9dc] | 419 | <para>
|
---|
| 420 | <filename>/etc/php.ini</filename>,
|
---|
[2037ec4] | 421 | <filename>/etc/pear.conf</filename>,
|
---|
| 422 | <filename>/etc/php-fpm.conf</filename>, and
|
---|
| 423 | <filename>/etc/php-fpm.d/www.conf</filename>
|
---|
[ac38e9dc] | 424 | </para>
|
---|
[db81e4cb] | 425 |
|
---|
| 426 | <indexterm zone="php php-config">
|
---|
| 427 | <primary sortas="e-etc-php.ini">/etc/php.ini</primary>
|
---|
| 428 | </indexterm>
|
---|
| 429 |
|
---|
| 430 | <indexterm zone="php php-config">
|
---|
| 431 | <primary sortas="e-etc-pear.conf">/etc/pear.conf</primary>
|
---|
| 432 | </indexterm>
|
---|
| 433 |
|
---|
[2037ec4] | 434 | <indexterm zone="php php-config">
|
---|
| 435 | <primary sortas="e-etc-php-fpm.d-www.conf">
|
---|
| 436 | /etc/php-fpm.d/www.conf</primary>
|
---|
| 437 | </indexterm>
|
---|
| 438 |
|
---|
[5178bbf6] | 439 | <indexterm zone="php php-config">
|
---|
| 440 | <primary sortas="e-etc-php-fpm.conf">/etc/php-fpm.conf</primary>
|
---|
| 441 | </indexterm>
|
---|
| 442 |
|
---|
[db81e4cb] | 443 | </sect3>
|
---|
| 444 |
|
---|
| 445 | <sect3>
|
---|
| 446 | <title>Configuration Information</title>
|
---|
| 447 |
|
---|
[2037ec4] | 448 | <para>
|
---|
| 449 | Without the file <filename>/etc/php-fpm.d/www.conf</filename>,
|
---|
| 450 | the process manager does not start. However, it is the file
|
---|
| 451 | <filename>/etc/php-fpm.d/www.conf.default</filename>, that is
|
---|
| 452 | installed. To solve this, issue as the
|
---|
| 453 | <systemitem class="username">root</systemitem> user:
|
---|
| 454 | </para>
|
---|
| 455 |
|
---|
| 456 | <screen role="root"><userinput>cp -v /etc/php-fpm.d/www.conf.default /etc/php-fpm.d/www.conf</userinput></screen>
|
---|
| 457 |
|
---|
[ac38e9dc] | 458 | <para>
|
---|
| 459 | The file used as the default <filename>/etc/php.ini</filename>
|
---|
| 460 | configuration file is recommended by the <application>PHP</application>
|
---|
| 461 | development team. This file modifies the default behavior of
|
---|
| 462 | <application>PHP</application>. If no <filename>/etc/php.ini</filename>
|
---|
| 463 | is used, all configuration settings fall to the defaults. You should
|
---|
| 464 | review the comments in this file and ensure the changes are acceptable
|
---|
| 465 | in your particular environment.
|
---|
| 466 | </para>
|
---|
[e797436] | 467 |
|
---|
[ac38e9dc] | 468 | <para>
|
---|
| 469 | You may have noticed the following from the output of the
|
---|
| 470 | <command>make install</command> command:
|
---|
| 471 | </para>
|
---|
[b84326b7] | 472 |
|
---|
[7c1d541] | 473 | <screen><computeroutput>You may want to add: /usr/lib/php to your php.ini include_path</computeroutput></screen>
|
---|
[b84326b7] | 474 |
|
---|
[ac38e9dc] | 475 | <para>
|
---|
| 476 | If desired, add the entry using the following command as the
|
---|
| 477 | <systemitem class="username">root</systemitem> user:
|
---|
| 478 | </para>
|
---|
[b84326b7] | 479 |
|
---|
[7c1d541] | 480 | <screen role="root"><userinput>sed -i 's@php/includes"@&\ninclude_path = ".:/usr/lib/php"@' \
|
---|
[b84326b7] | 481 | /etc/php.ini</userinput></screen>
|
---|
| 482 |
|
---|
[ac38e9dc] | 483 | <para>
|
---|
| 484 | To enable fastCGI support in the <application>Apache</application>
|
---|
| 485 | web server, two LoadModule directives must be added to the
|
---|
| 486 | <filename>httpd.conf</filename> file. They are commented out, so just
|
---|
| 487 | issue the following command as
|
---|
| 488 | <systemitem class="username">root</systemitem> user:
|
---|
| 489 | </para>
|
---|
[db81e4cb] | 490 |
|
---|
[2037ec4] | 491 | <screen role="root"><userinput>sed -i -e '/proxy_module/s/^#//' \
|
---|
| 492 | -e '/proxy_fcgi_module/s/^#//' \
|
---|
| 493 | /etc/httpd/httpd.conf</userinput></screen>
|
---|
[db81e4cb] | 494 |
|
---|
[ac38e9dc] | 495 | <para>
|
---|
| 496 | Those modules accept various <command>ProxyPass</command>
|
---|
| 497 | directives. One possibility is (as the
|
---|
| 498 | <systemitem class="username">root</systemitem> user):
|
---|
| 499 | </para>
|
---|
[5178bbf6] | 500 |
|
---|
[2037ec4] | 501 | <screen role="root"><userinput>echo \
|
---|
| 502 | 'ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/srv/www/$1' >> \
|
---|
| 503 | /etc/httpd/httpd.conf</userinput></screen>
|
---|
[5178bbf6] | 504 |
|
---|
[ac38e9dc] | 505 | <para>
|
---|
| 506 | Additionally, it may be useful to add an entry for
|
---|
| 507 | <filename>index.php</filename> to the DirectoryIndex directive of the
|
---|
| 508 | <filename>httpd.conf</filename> file. Lastly, adding a line to setup the
|
---|
| 509 | <filename class='extension'>.phps</filename> extension to show
|
---|
| 510 | highlighted <application>PHP</application> source may be
|
---|
| 511 | desirable:
|
---|
| 512 | </para>
|
---|
[e797436] | 513 |
|
---|
| 514 | <screen><literal>AddType application/x-httpd-php-source .phps</literal></screen>
|
---|
[db81e4cb] | 515 |
|
---|
[ac38e9dc] | 516 | <para>
|
---|
| 517 | You'll need to restart the <application>Apache</application> web server
|
---|
| 518 | after making any modifications to the <filename>httpd.conf</filename>
|
---|
| 519 | file.
|
---|
| 520 | </para>
|
---|
[db81e4cb] | 521 |
|
---|
| 522 | </sect3>
|
---|
| 523 |
|
---|
[5178bbf6] | 524 | <sect3 id="php-init">
|
---|
[1aab91a] | 525 | <title>Systemd Units</title>
|
---|
[5178bbf6] | 526 |
|
---|
| 527 | <para>
|
---|
[1aab91a] | 528 | To start the <command>php-fpm</command> daemon at boot,
|
---|
| 529 | install the systemd unit from the <xref linkend="bootscripts"/>
|
---|
| 530 | package by running the following command as the
|
---|
[5178bbf6] | 531 | <systemitem class="username">root</systemitem> user:
|
---|
| 532 | </para>
|
---|
| 533 |
|
---|
| 534 | <indexterm zone="php php-init">
|
---|
[1aab91a] | 535 | <primary sortas="f-php-fpm">php-fpm</primary>
|
---|
[5178bbf6] | 536 | </indexterm>
|
---|
| 537 |
|
---|
[1aab91a] | 538 | <screen role="root"><userinput>make install-php-fpm</userinput></screen>
|
---|
[5178bbf6] | 539 | </sect3>
|
---|
| 540 |
|
---|
[db81e4cb] | 541 | </sect2>
|
---|
| 542 |
|
---|
| 543 | <sect2 role="content">
|
---|
| 544 | <title>Contents</title>
|
---|
| 545 |
|
---|
| 546 | <segmentedlist>
|
---|
| 547 | <segtitle>Installed Programs</segtitle>
|
---|
[1c345ed] | 548 | <segtitle>Installed Libraries</segtitle>
|
---|
[db81e4cb] | 549 | <segtitle>Installed Directories</segtitle>
|
---|
| 550 |
|
---|
| 551 | <seglistitem>
|
---|
[2037ec4] | 552 | <seg>pear, peardev, pecl, phar (symlink), phar.phar, php,
|
---|
| 553 | php-cgi, php-config, php-fpm, phpdbg, and phpize</seg>
|
---|
| 554 | <seg>dba.{so,a} and opcache.{so,a} at
|
---|
| 555 | /usr/lib/php/extensions/no-debug-non-zts-20151012</seg>
|
---|
| 556 | <seg>/etc/php-fpm.d, /usr/{include,lib,share}/php and
|
---|
[ba1a38b] | 557 | /usr/share/doc/php-&php-version;</seg>
|
---|
[db81e4cb] | 558 | </seglistitem>
|
---|
| 559 | </segmentedlist>
|
---|
| 560 |
|
---|
| 561 | <variablelist>
|
---|
| 562 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 563 | <?dbfo list-presentation="list"?>
|
---|
| 564 | <?dbhtml list-presentation="table"?>
|
---|
| 565 |
|
---|
| 566 | <varlistentry id="php-prog">
|
---|
| 567 | <term><command>php</command></term>
|
---|
| 568 | <listitem>
|
---|
[ac38e9dc] | 569 | <para>
|
---|
| 570 | is a command line interface that enables you to parse and
|
---|
| 571 | execute PHP code.
|
---|
| 572 | </para>
|
---|
[db81e4cb] | 573 | <indexterm zone="php php-prog">
|
---|
| 574 | <primary sortas="b-php">php</primary>
|
---|
| 575 | </indexterm>
|
---|
| 576 | </listitem>
|
---|
| 577 | </varlistentry>
|
---|
| 578 |
|
---|
| 579 | <varlistentry id="pear">
|
---|
| 580 | <term><command>pear</command></term>
|
---|
| 581 | <listitem>
|
---|
[ac38e9dc] | 582 | <para>
|
---|
| 583 | is the PHP Extension and Application Repository (PEAR) package
|
---|
| 584 | manager.
|
---|
| 585 | </para>
|
---|
[db81e4cb] | 586 | <indexterm zone="php pear">
|
---|
| 587 | <primary sortas="b-pear">pear</primary>
|
---|
| 588 | </indexterm>
|
---|
| 589 | </listitem>
|
---|
| 590 | </varlistentry>
|
---|
| 591 |
|
---|
[5178bbf6] | 592 | <varlistentry id="php-fpm">
|
---|
| 593 | <term><command>php-fpm</command></term>
|
---|
| 594 | <listitem>
|
---|
[ac38e9dc] | 595 | <para>
|
---|
| 596 | is the fastCGI process manager for PHP.
|
---|
| 597 | </para>
|
---|
[5178bbf6] | 598 | <indexterm zone="php php-fpm">
|
---|
| 599 | <primary sortas="b-php-fpm">php-fpm</primary>
|
---|
| 600 | </indexterm>
|
---|
| 601 | </listitem>
|
---|
| 602 | </varlistentry>
|
---|
| 603 |
|
---|
[2037ec4] | 604 | <varlistentry id="phpdbg">
|
---|
| 605 | <term><command>phpdbg</command></term>
|
---|
| 606 | <listitem>
|
---|
| 607 | <para>
|
---|
| 608 | is the interactive PHP debugger.
|
---|
| 609 | </para>
|
---|
| 610 | <indexterm zone="php phpdbg">
|
---|
| 611 | <primary sortas="b-phpdbg">phpdbg</primary>
|
---|
| 612 | </indexterm>
|
---|
| 613 | </listitem>
|
---|
| 614 | </varlistentry>
|
---|
| 615 |
|
---|
[db81e4cb] | 616 | </variablelist>
|
---|
| 617 |
|
---|
| 618 | </sect2>
|
---|
[f45b1953] | 619 |
|
---|
| 620 | </sect1>
|
---|