Skip to content

Commit 4cb53ec

Browse files
authored
Move/rewrite much of the macOS and Unix install instructions (#3763)
Tried to put more emphasis on how to install from packages (either from distributions or third parties) and for Unix, in particular, move the stuff about compiling from source down a level so new users don't get knocked in the face with it.
1 parent dafb150 commit 4cb53ec

File tree

8 files changed

+321
-252
lines changed

8 files changed

+321
-252
lines changed

install/macos/index.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
<!-- $Revision$ -->
33
<chapter xml:id="install.macosx" xmlns="http://docbook.org/ns/docbook">
44
<title>Installation on macOS</title>
5-
<para>
6-
This section contains notes and hints specific to installing PHP on macOS.
7-
PHP is bundled with macOS since macOS X (10.0.0) prior to macOS Monterey (12.0.0).
8-
Compiling is similar to the <link linkend="install.unix">Unix installation guide</link>.
9-
</para>
5+
<simpara>
6+
PHP was bundled with macOS in versions 10 and 11, but is not included in versions
7+
since macOS 12 (Monterey). Installation on recent versions either requires using
8+
packages from third-party sources, or compilation from source.
9+
</simpara>
1010
&install.macos.packages;
11-
&install.macos.bundled;
1211
&install.macos.compile;
12+
&install.macos.bundled;
1313
</chapter>
1414

1515
<!-- Keep this comment at the end of the file

install/macos/packages.xml

Lines changed: 24 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
33
<sect1 xml:id="install.macosx.packages" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
4-
<title>Using Packages</title>
4+
<title>Installation on macOS using third-party packages</title>
55
<simpara>
66
There are a few pre-packaged and pre-compiled versions of PHP for
77
macOS. This can help in setting up a standard
@@ -13,49 +13,33 @@
1313
version of PHP with the features you need.
1414
</simpara>
1515
<simpara>
16-
The quickest way to install php on macOS is with homebrew:
16+
An easy way to install PHP on macOS is with the
17+
<link xlink:href="https://brew.sh/">Homebrew</link> packaging manager.
1718
</simpara>
18-
<para>
19-
<orderedlist>
20-
<listitem>
21-
<para>
22-
install homebrew, by following the instructions at <link xlink:href="https://brew.sh/">brew.sh</link>
23-
</para>
24-
</listitem>
25-
<listitem>
26-
<simpara>
27-
brew install php
28-
</simpara>
29-
</listitem>
30-
</orderedlist>
31-
</para>
19+
<orderedlist>
20+
<listitem>
21+
<para>
22+
Install Homebrew by following the instructions on the website.
23+
</para>
24+
</listitem>
25+
<listitem>
26+
<simpara>
27+
<command>brew install php</command>
28+
</simpara>
29+
</listitem>
30+
</orderedlist>
3231
<simpara>
3332
The following alternative resources also offer easy to install packages and
34-
precompiled binaries for PHP on Mac OS:
33+
precompiled binaries for PHP on macOS:
3534
</simpara>
36-
<para>
37-
<itemizedlist>
38-
<listitem>
39-
<simpara>
40-
MacPorts:
41-
<link xlink:href="&url.mac.macports;">&url.mac.macports;</link>
42-
</simpara>
43-
</listitem>
44-
<listitem>
45-
<simpara>
46-
Liip:
47-
<link xlink:href="&url.mac.liip;">&url.mac.liip;</link>
48-
(PHP 5.3 - PHP 7.3; deprecated)
49-
</simpara>
50-
</listitem>
51-
<listitem>
52-
<simpara>
53-
Fink:
54-
<link xlink:href="&url.mac.fink;">&url.mac.fink;</link>
55-
</simpara>
56-
</listitem>
57-
</itemizedlist>
58-
</para>
35+
<simplelist>
36+
<member>
37+
<link xlink:href="&url.mac.macports;">MacPorts</link>
38+
</member>
39+
<member>
40+
<link xlink:href="&url.mac.fink;">Fink</link>
41+
</member>
42+
</simplelist>
5943
</sect1>
6044

6145
<!-- Keep this comment at the end of the file

install/unix/debian.xml

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
33
<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>
55
<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.
810
</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;
1712
<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</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.
2216
</para>
2317
<sect2 xml:id="install.unix.debian.apt">
2418
<title>Using APT</title>
@@ -63,7 +57,7 @@
6357
<link linkend="book.mysql">MySQL</link>,
6458
<link linkend="book.curl">cURL</link>,
6559
<link linkend="book.image">GD</link>,
66-
etc. These may also be installed via the <literal>apt</literal> command.
60+
etc. These may also be installed via the <command>apt</command> command.
6761
</simpara>
6862
<example xml:id="install.unix.debian.config.example">
6963
<title>Methods for listing additional PHP packages</title>
@@ -76,12 +70,12 @@
7670
</programlisting>
7771
</example>
7872
<simpara>
79-
The examples will show a lot of packages including several PHP specific ones
80-
like php-cgi, php-cli and php-dev. Determine which are needed
81-
and install them like any other with either <literal>apt</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.
8579
</simpara>
8680
<example xml:id="install.unix.debian.config.example2">
8781
<title>Install PHP with MySQL, cURL</title>
@@ -119,14 +113,6 @@
119113
server was restarted after installation.
120114
</simpara>
121115
</listitem>
122-
<listitem>
123-
<simpara>
124-
There are two basic commands for installing packages on Debian (and other
125-
linux variants): <literal>apt</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>
130116
</itemizedlist>
131117
</sect2>
132118
</sect1>

install/unix/dnf.xml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- $Revision$ -->
3+
<sect1 xml:id="install.unix.dnf" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
4+
<title>Installing from packages on GNU/Linux distributions that use DNF</title>
5+
<simpara>
6+
While PHP can be installed from source, it is also available through
7+
packages on systems that use DNF, such as Red Hat Enterprise Linux,
8+
OpenSUSE, Fedora, CentOS, Rocky Linux, and Oracle Enterprise Linux.
9+
</simpara>
10+
&warn.install.third-party-support;
11+
<simpara>
12+
The packages can be installed using the <command>dnf</command> command.
13+
</simpara>
14+
<sect2 xml:id="install.unix.dnf.packages">
15+
<title>Installing packages</title>
16+
<simpara>
17+
First, note that other related packages may be desired like
18+
<literal>php-pear</literal> for <link xlink:href="&url.pear;">PEAR</link>,
19+
or <literal>php-mysqlnd</literal> for the <link linkend="book.mysqlnd">MySQL
20+
extension</link>.
21+
</simpara>
22+
<simpara>
23+
Second, before installing a package, it's wise to ensure the package list
24+
is up to date. Typically, this is done by running the command
25+
<command>dnf update</command>.
26+
</simpara>
27+
<example xml:id="install.unix.dnf.example">
28+
<title>DNF Install Example</title>
29+
<programlisting role="shell">
30+
<![CDATA[
31+
# dnf install php php-common
32+
]]>
33+
</programlisting>
34+
</example>
35+
<simpara>
36+
DNF will automatically install the configuration for PHP for the web server,
37+
but it may need to be restarted in order for the changes to take effect.
38+
For example:
39+
</simpara>
40+
<example xml:id="install.unix.dnf.example2">
41+
<title>Restarting Apache once PHP is installed</title>
42+
<programlisting role="shell">
43+
<![CDATA[
44+
# sudo systemctl restart httpd
45+
]]>
46+
</programlisting>
47+
</example>
48+
</sect2>
49+
<sect2 xml:id="install.unix.dnf.config">
50+
<title>Better control of configuration</title>
51+
<para>
52+
In the last section, PHP was installed with only core modules. It's
53+
very likely that additional modules will be desired, such as
54+
<simplelist type="inline">
55+
<member><link linkend="book.mysql">MySQL</link></member>
56+
<member><link linkend="book.curl">cURL</link></member>
57+
<member><link linkend="book.image">GD</link></member>
58+
<member>etc.</member>
59+
</simplelist>
60+
These may also be installed via the <command>dnf</command> command.
61+
</para>
62+
<example xml:id="install.unix.dnf.config.example">
63+
<title>Methods for listing additional PHP packages</title>
64+
<programlisting role="shell">
65+
<![CDATA[
66+
# dnf search php
67+
]]>
68+
</programlisting>
69+
</example>
70+
<simpara>
71+
The list of packages will include a large number of packages that includes
72+
basic PHP components, such as <literal>php-cli</literal>,
73+
<literal>php-fpm</literal>, and <literal>php-devel</literal>, as well as
74+
many PHP extensions. When extensions are installed, additional packages
75+
will be automatically installed as necessary to satisfy the dependencies
76+
of those packages.
77+
</simpara>
78+
<example xml:id="install.unix.dnf.config.example2">
79+
<title>Install PHP with MySQL, GD</title>
80+
<programlisting role="shell">
81+
<![CDATA[
82+
# dnf install php-mysqlnd php-gd
83+
]]>
84+
</programlisting>
85+
</example>
86+
<simpara>
87+
DNF will automatically add the appropriate lines to the
88+
different &php.ini; related files like
89+
<filename>/etc/php/8.3/php.ini</filename>,
90+
<filename>/etc/php/8.3/conf.d/*.ini</filename>, etc. and depending on
91+
the extension will add entries similar to <literal>extension=foo.so</literal>.
92+
However, restarting the web server (like Apache) is required before these
93+
changes take affect.
94+
</simpara>
95+
</sect2>
96+
</sect1>
97+
<!-- Keep this comment at the end of the file
98+
Local variables:
99+
mode: sgml
100+
sgml-omittag:t
101+
sgml-shorttag:t
102+
sgml-minimize-attributes:nil
103+
sgml-always-quote-attributes:t
104+
sgml-indent-step:1
105+
sgml-indent-data:t
106+
indent-tabs-mode:nil
107+
sgml-parent-document:nil
108+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
109+
sgml-exposed-tags:nil
110+
sgml-local-catalogs:nil
111+
sgml-local-ecat-files:nil
112+
End:
113+
vim600: syn=xml fen fdm=syntax fdl=2 si
114+
vim: et tw=78 syn=sgml
115+
vi: ts=1 sw=1
116+
-->

0 commit comments

Comments
 (0)