install/unix/debian.xml
4cb53ecbd763db2db808e90d7eda63afb380e6df
4cb53ecbd763db2db808e90d7eda63afb380e6df
...
...
@@ -1,47 +1,41 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
3
<sect1 xml:id="install.unix.debian" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
4
-
<title>Debian GNU/Linux installation notes</title>
4
+
<title>Installing from packages on Debian GNU/Linux and related distributions</title>
5
5
<para>
6
-
This section contains notes and hints specific to installing
7
-
PHP on <link xlink:href="&url.debian;">Debian GNU/Linux</link>.
6
+
While PHP can be installed from source, it is also available through
7
+
packages from <link xlink:href="&url.debian;">Debian GNU/Linux</link>.
8
+
This is also true for other distributions based on Debian, such as
9
+
Ubuntu, Kali Linux, and Linux Mint.
8
10
</para>
9
-
<warning>
10
-
<para>
11
-
Unofficial builds from third-parties are not supported here. Any bugs
12
-
should be reported to the Debian team unless they can be reproduced using
13
-
the latest builds from our <link xlink:href="&url.php.downloads;">download
14
-
area</link>.
15
-
</para>
16
-
</warning>
11
+
&warn.install.third-party-support;
17
12
<para>
18
-
While the instructions for building PHP on Unix apply to Debian as well,
19
-
this manual page contains specific information for other options, such as
20
-
using either the <literal>apt-get</literal> or <literal>aptitude</literal>
21
-
commands. This manual page uses these two commands interchangeably.
13
+
The packages can be installed using either the <command>apt</command> or
14
+
<command>aptitude</command> commands. This manual page uses these two
15
+
commands interchangeably.
22
16
</para>
23
17
<sect2 xml:id="install.unix.debian.apt">
24
18
<title>Using APT</title>
25
19
<simpara>
26
20
First, note that other related packages may be desired like
27
-
<literal>libapache2-mod-php5</literal> to integrate with Apache 2, and
21
+
<literal>libapache-mod-php</literal> to integrate with Apache 2, and
28
22
<literal>php-pear</literal> for PEAR.
29
23
</simpara>
30
24
<simpara>
31
25
Second, before installing a package, it's wise to ensure the package list
32
26
is up to date. Typically, this is done by running the command
33
-
<command>apt-get update</command>.
27
+
<command>apt update</command>.
34
28
</simpara>
35
29
<example xml:id="install.unix.debian.apt.example">
36
30
<title>Debian Install Example with Apache 2</title>
37
31
<programlisting role="shell">
38
32
<![CDATA[
39
-
# apt-get install php5-common libapache2-mod-php5 php5-cli
33
+
# apt install php-common libapache2-mod-php php-cli
40
34
]]>
41
35
</programlisting>
42
36
</example>
43
37
<simpara>
44
-
APT will automatically install the PHP 5 module for Apache 2 and all of its
38
+
APT will automatically install the PHP module for Apache 2 and all of its
45
39
dependencies, and then activate it. Apache should be restarted in order for
46
40
the changes take place. For example:
47
41
</simpara>
...
...
@@ -63,39 +57,39 @@
63
57
<link linkend="book.mysql">MySQL</link>,
64
58
<link linkend="book.curl">cURL</link>,
65
59
<link linkend="book.image">GD</link>,
66
-
etc. These may also be installed via the <literal>apt-get</literal> command.
60
+
etc. These may also be installed via the <command>apt</command> command.
67
61
</simpara>
68
62
<example xml:id="install.unix.debian.config.example">
69
-
<title>Methods for listing additional PHP 5 packages</title>
63
+
<title>Methods for listing additional PHP packages</title>
70
64
<programlisting role="shell">
71
65
<![CDATA[
72
-
# apt-cache search php5
73
-
# aptitude search php5
74
-
# aptitude search php5 |grep -i mysql
66
+
# apt-cache search php
67
+
# apt search php | grep -i mysql
68
+
# aptitude search php
75
69
]]>
76
70
</programlisting>
77
71
</example>
78
72
<simpara>
79
-
The examples will show a lot of packages including several PHP specific ones
80
-
like php5-cgi, php5-cli and php5-dev. Determine which are needed
81
-
and install them like any other with either <literal>apt-get</literal>
82
-
or <literal>aptitude</literal>. And because Debian performs
83
-
dependency checks, it'll prompt for those so for example to install
84
-
MySQL and cURL:
73
+
The list of packages will include a large number of packages that includes
74
+
basic PHP components, such as <literal>php-cgi</literal>,
75
+
<literal>php-cli</literal>, and <literal>php-dev</literal>, as well as
76
+
many PHP extensions. When extensions are installed, additional packages
77
+
will be automatically installed as necessary to satisfy the dependencies
78
+
of those packages.
85
79
</simpara>
86
80
<example xml:id="install.unix.debian.config.example2">
87
81
<title>Install PHP with MySQL, cURL</title>
88
82
<programlisting role="shell">
89
83
<![CDATA[
90
-
# apt-get install php5-mysql php5-curl
84
+
# apt install php-mysql php-curl
91
85
]]>
92
86
</programlisting>
93
87
</example>
94
88
<simpara>
95
89
APT will automatically add the appropriate lines to the
96
90
different &php.ini; related files like
97
-
<filename>/etc/php5/apache2/php.ini</filename>,
98
-
<filename>/etc/php5/conf.d/pdo.ini</filename>, etc. and depending on
91
+
<filename>/etc/php/7.4/php.ini</filename>,
92
+
<filename>/etc/php/7.4/conf.d/*.ini</filename>, etc. and depending on
99
93
the extension will add entries similar to <literal>extension=foo.so</literal>.
100
94
However, restarting the web server (like Apache) is required before these
101
95
changes take affect.
...
...
@@ -119,14 +113,6 @@
119
113
server was restarted after installation.
120
114
</simpara>
121
115
</listitem>
122
-
<listitem>
123
-
<simpara>
124
-
There are two basic commands for installing packages on Debian (and other
125
-
linux variants): <literal>apt-get</literal> and <literal>aptitude</literal>.
126
-
However, explaining the subtle differences between these commands goes
127
-
beyond the scope of this manual.
128
-
</simpara>
129
-
</listitem>
130
116
</itemizedlist>
131
117
</sect2>
132
118
</sect1>
133
119