1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
|
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 288721 $ -->
<sect1 xml:id="install.unix.debian" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Debian GNU/Linux installation notes</title>
<para>
This section contains notes and hints specific to installing
PHP on <link xlink:href="&url.debian;">Debian GNU/Linux</link>.
</para>
<para>
While the instructions for building PHP on Unix apply to Debian as well,
this manual page contains specific information for other options, such as
using either the <literal>apt-get</literal> or <literal>aptitude</literal>
commands. This manual page uses these two commands interchangeably.
</para>
<sect2 xml:id="install.unix.debian.apt">
<title>Using APT</title>
<simpara>
First, note that other related packages may be desired like
<literal>libapache2-mod-php5</literal> to integrate with Apache 2, and
<literal>php-pear</literal> for PEAR.
</simpara>
<simpara>
Second, before installing a package, it's wise to ensure the package list
is up to date. Typically, this is done by running the command
<command>apt-get update</command>.
</simpara>
<example xml:id="install.unix.debian.apt.example">
<title>Debian Install Example with Apache 2</title>
<programlisting role="shell">
<![CDATA[
# apt-get install php5-common libapache2-mod-php5 php5-cli
]]>
</programlisting>
</example>
<simpara>
APT will automatically install the PHP 5 module for Apache 2 and all of its
dependencies, and then activate it. Apache should be restarted in order for
the changes take place. For example:
</simpara>
<example xml:id="install.unix.debian.apt.example2">
<title>Stopping and starting Apache once PHP is installed</title>
<programlisting role="shell">
<![CDATA[
# /etc/init.d/apache2 stop
# /etc/init.d/apache2 start
]]>
</programlisting>
</example>
</sect2>
<sect2 xml:id="install.unix.debian.config">
<title>Better control of configuration</title>
<simpara>
In the last section, PHP was installed with only core modules. It's
very likely that additional modules will be desired, such as
<link linkend="book.mysql">MySQL</link>,
<link linkend="book.curl">cURL</link>,
<link linkend="book.image">GD</link>,
etc. These may also be installed via the <literal>apt-get</literal> command.
</simpara>
<example xml:id="install.unix.debian.config.example">
<title>Methods for listing additional PHP 5 packages</title>
<programlisting role="shell">
<![CDATA[
# apt-cache search php5
# aptitude search php5
# aptitude search php5 |grep -i mysql
]]>
</programlisting>
</example>
<simpara>
The examples will show a lot of packages including several PHP specific ones
like php5-cgi, php5-cli and php5-dev. Determine which are needed
and install them like any other with either <literal>apt-get</literal>
or <literal>aptitude</literal>. And because Debian performs
dependency checks, it'll prompt for those so for example to install
MySQL and cURL:
</simpara>
<example xml:id="install.unix.debian.config.example2">
<title>Install PHP with MySQL, cURL</title>
<programlisting role="shell">
<![CDATA[
# apt-get install php5-mysql php5-curl
]]>
</programlisting>
</example>
<simpara>
APT will automatically add the appropriate lines to the
different &php.ini; related files like
<filename>/etc/php5/apache2/php.ini</filename>,
<filename>/etc/php5/conf.d/pdo.ini</filename>, etc. and depending on
the extension will add entries similar to <literal>extension=foo.so</literal>.
However, restarting the web server (like Apache) is required before these
changes take affect.
</simpara>
</sect2>
<sect2 xml:id="install.unix.debian.faq">
<title>Common Problems</title>
<itemizedlist>
<listitem>
<simpara>
If the PHP scripts are not parsing via the web server, then it's
likely that PHP was not added to the web server's configuration
file, which on Debian may be <filename>/etc/apache2/apache2.conf</filename>
or similar. See the Debian manual for further details.
</simpara>
</listitem>
<listitem>
<simpara>
If an extension was seemingly installed yet the functions are undefined,
be sure that the appropriate ini file is being loaded and/or the web
server was restarted after installation.
</simpara>
</listitem>
<listitem>
<simpara>
There are two basic commands for installing packages on Debian (and other
linux variants): <literal>apt-get</literal> and <literal>aptitude</literal>.
However, explaining the subtle differences between these commands goes
beyond the scope of this manual.
</simpara>
</listitem>
</itemizedlist>
</sect2>
</sect1>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
|