<?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 => 'es',
  ),
  'this' => 
  array (
    0 => 'install.unix.alpine.php',
    1 => 'Installing from packages on Alpine Linux',
    2 => 'Installing from packages on Alpine Linux',
  ),
  'up' => 
  array (
    0 => 'install.unix.php',
    1 => 'Instalaci&oacute;n en sistemas Unix',
  ),
  'prev' => 
  array (
    0 => 'install.unix.dnf.php',
    1 => 'Instalaci&oacute;n a partir de paquetes en distribuciones GNU/Linux que utilizan DNF',
  ),
  'next' => 
  array (
    0 => 'install.unix.pacman.php',
    1 => 'Installing from packages on Arch Linux',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'install/unix/alpine.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="install.unix.alpine" class="sect1">
 <h2 class="title">Installing from packages on Alpine Linux</h2>
 <p class="simpara">
  While PHP can be installed from source, it is also available through
  packages on Alpine Linux and derivatives that use the
  <strong class="command">apk</strong> package manager.
 </p>
 <div class="warning"><strong class="warning">Advertencia</strong>
 <p class="simpara">
  Las versiones provenientes de terceros son consideradas no oficiales y
  no son directamente soportadas por el proyecto PHP. Cualquier bug encontrado debe ser reportado al proveedor
  de estas versiones no oficiales, a menos que pueda ser reproducido utilizando las versiones
  provenientes de <a href="https://www.php.net/downloads.php" class="link external">&raquo;&nbsp; la zona de descargas
  oficial</a>.
 </p>
</div>
 <p class="simpara">
  The packages can be installed using the <strong class="command">apk</strong> package manager.
 </p>
 <div class="sect2" id="install.unix.alpine.packages">
  <h3 class="title">Installing packages</h3>
  <p class="simpara">
   PHP packages in Alpine Linux include the major version number in their name
   (e.g. <code class="literal">php83</code> for PHP 8.3). In the examples below, replace
   <code class="literal">83</code> with the PHP version available on your Alpine Linux release.
  </p>
  <p class="simpara">
   Before installing a package, ensure the package index is up to
   date by running <strong class="command">apk update</strong>.
  </p>
  <div class="example" id="install.unix.alpine.example">
   <p><strong>Ejemplo #1 Alpine Install Example</strong></p>
   <div class="example-contents">
<div class="shellcode"><pre class="shellcode"># apk add php83</pre>
</div>
   </div>

  </div>
  <p class="simpara">
   Alpine does not configure PHP for a web server automatically.
   For FastCGI setups, install <code class="literal">php83-fpm</code> and enable
   the <code class="literal">php-fpm83</code> OpenRC service (note that the package
   name and the service name use different ordering of the version suffix).
   For example:
  </p>
  <div class="example" id="install.unix.alpine.example2">
   <p><strong>Ejemplo #2 Enabling and starting PHP-FPM</strong></p>
   <div class="example-contents">
<div class="shellcode"><pre class="shellcode"># apk add php83-fpm
# rc-update add php-fpm83 default
# rc-service php-fpm83 start</pre>
</div>
   </div>

  </div>
 </div>
 <div class="sect2" id="install.unix.alpine.config">
  <h3 class="title">Better control of configuration</h3>
  <p class="para">
   Only the core extensions are installed with the base package. Additional
   extensions 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>
   can be installed as separate packages.
  </p>
  <div class="example" id="install.unix.alpine.config.example">
   <p><strong>Ejemplo #3 Searching for available PHP packages</strong></p>
   <div class="example-contents">
<div class="shellcode"><pre class="shellcode"># apk search php83</pre>
</div>
   </div>

  </div>
  <p class="simpara">
   The list of packages includes the CLI, FPM, and many extensions.
   When extensions are installed, their dependencies are automatically
   resolved.
  </p>
  <div class="example" id="install.unix.alpine.config.example2">
   <p><strong>Ejemplo #4 Install PHP with MySQL, GD</strong></p>
   <div class="example-contents">
<div class="shellcode"><pre class="shellcode"># apk add php83-mysqli php83-gd</pre>
</div>
   </div>

  </div>
  <p class="simpara">
   Extensions are automatically enabled when installed; no manual
   <var class="filename">php.ini</var> editing is required. Configuration files are placed in
   <var class="filename">/etc/php83/conf.d/</var>. After installing new
   extensions, PHP-FPM (or the web server) needs to be restarted for
   the changes to take effect.
  </p>
 </div>
</div><?php manual_footer($setup); ?>