Skip to content

Commit f0f5d86

Browse files
authored
Add install documentation for Arch Linux (pacman) (#5259)
* Add install documentation for Arch Linux (pacman) * fix(pacman): correct Apache integration and extension activation - Add php-apache to the install example (pacman -S php alone does not enable PHP in Apache on Arch Linux) - Add mention of php-fpm for FastCGI setups - Remove sudo from systemctl command (# prompt implies root) - Fix example title: 'Install PHP with MySQL, GD' -> 'Install PHP with GD' to match the actual command (pacman -S php-gd) - Correct the extension activation paragraph: on Arch, pacman does not automatically add lines to php.ini; the user must manually uncomment the relevant extension= line in /etc/php/php.ini
1 parent 0d8ee21 commit f0f5d86

2 files changed

Lines changed: 114 additions & 0 deletions

File tree

install/unix/index.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<!-- distribution specific nodes -->
2828
&install.unix.debian;
2929
&install.unix.dnf;
30+
&install.unix.pacman;
3031
&install.unix.openbsd;
3132
<!-- general from-source instructions -->
3233
&install.unix.source;

install/unix/pacman.xml

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

0 commit comments

Comments
 (0)