<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/install.unix.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'install.unix.pacman.php',
    1 => 'Installing from packages on Arch Linux',
    2 => 'Installing from packages on Arch Linux',
  ),
  'up' => 
  array (
    0 => 'install.unix.php',
    1 => 'Installation on Unix systems',
  ),
  'prev' => 
  array (
    0 => 'install.unix.alpine.php',
    1 => 'Installing from packages on Alpine Linux',
  ),
  'next' => 
  array (
    0 => 'install.unix.openbsd.php',
    1 => 'Installing from packages or ports on OpenBSD',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'install/unix/pacman.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="install.unix.pacman" class="sect1">
 <h2 class="title">Installing from packages on Arch Linux</h2>
 <p class="simpara">
  While PHP can be installed from source, it is also available through
  packages on Arch Linux and derivatives that use pacman.
 </p>
 <div class="warning"><strong class="warning">Warning</strong>
 <p class="simpara">
  Builds from third-parties are considered unofficial and not directly
  supported by the PHP project. Any bugs encountered should be reported to the
  provider of those unofficial builds unless they can be reproduced using the
  builds from <a href="https://www.php.net/downloads.php" class="link external">&raquo;&nbsp;the official download
  area</a>.
 </p>
</div>
 <p class="simpara">
  The packages can be installed using the <strong class="command">pacman</strong> command.
 </p>
 <div class="sect2" id="install.unix.pacman.packages">
  <h3 class="title">Installing packages</h3>
  <p class="simpara">
   First, note that other related packages may be desired, such as
   <code class="literal">php-apache</code> for <a href="install.unix.apache2.php" class="link">Apache</a>,
   or <code class="literal">php-fpm</code> for FastCGI setups.
  </p>
  <p class="simpara">
   Before installing a package, it is recommended to ensure the system
   is up to date. Typically, this is done by running the command
   <strong class="command">pacman -Syu</strong>.
  </p>
  <div class="example" id="install.unix.pacman.example">
   <p><strong>Example #1 Pacman Install Example with Apache</strong></p>
   <div class="example-contents">
<div class="shellcode"><pre class="shellcode"># pacman -S php php-apache</pre>
</div>
   </div>

  </div>
  <p class="simpara">
   Pacman will automatically install all dependencies for PHP.
   The web server may need to be restarted in order for the changes to
   take effect. For example:
  </p>
  <div class="example" id="install.unix.pacman.example2">
   <p><strong>Example #2 Restarting Apache once PHP is installed</strong></p>
   <div class="example-contents">
<div class="shellcode"><pre class="shellcode"># systemctl restart httpd</pre>
</div>
   </div>

  </div>
 </div>
 <div class="sect2" id="install.unix.pacman.config">
  <h3 class="title">Better control of configuration</h3>
  <p class="para">
   In the last section, PHP was installed with only core modules. It is
   very likely that additional modules will be desired, such as
   <span class="simplelist"><a href="book.mysql.php" class="link">MySQL</a>, <a href="book.curl.php" class="link">cURL</a>, <a href="book.image.php" class="link">GD</a>, etc.</span>
   These may also be installed via the <strong class="command">pacman</strong> command.
  </p>
  <div class="example" id="install.unix.pacman.config.example">
   <p><strong>Example #3 Methods for listing additional PHP packages</strong></p>
   <div class="example-contents">
<div class="shellcode"><pre class="shellcode"># pacman -Ss php</pre>
</div>
   </div>

  </div>
  <p class="simpara">
   The list of packages will include a number of packages that includes
   PHP extensions such as <code class="literal">php-gd</code>,
   <code class="literal">php-intl</code>, <code class="literal">php-sqlite</code>, and others.
   When extensions are installed, additional packages
   will be automatically installed as necessary to satisfy the dependencies
   of those packages.
  </p>
  <div class="example" id="install.unix.pacman.config.example2">
   <p><strong>Example #4 Install PHP with GD</strong></p>
   <div class="example-contents">
<div class="shellcode"><pre class="shellcode"># pacman -S php-gd</pre>
</div>
   </div>

  </div>
  <p class="simpara">
   After installing an extension package, the corresponding entry in
   <var class="filename">/etc/php/php.ini</var> must be uncommented to enable it.
   For example, after installing <code class="literal">php-gd</code>, uncomment the line
   <code class="literal">extension=gd</code> in <var class="filename">/etc/php/php.ini</var>.
   Restarting the web server (like Apache) is required before these
   changes take effect.
  </p>
 </div>
</div><?php manual_footer($setup); ?>