While PHP can be installed from source, it is also available through packages on Arch Linux and derivatives that use pacman.
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 » la zona de descargas oficial.
The packages can be installed using the pacman command.
First, note that other related packages may be desired, such as
php-apache for Apache,
or php-fpm for FastCGI setups.
Before installing a package, it is recommended to ensure the system is up to date. Typically, this is done by running the command pacman -Syu.
Ejemplo #1 Pacman Install Example with Apache
# pacman -S php php-apache
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:
Ejemplo #2 Restarting Apache once PHP is installed
# systemctl restart httpd
In the last section, PHP was installed with only core modules. It is very likely that additional modules will be desired, such as MySQL, cURL, GD, etc. These may also be installed via the pacman command.
Ejemplo #3 Methods for listing additional PHP packages
# pacman -Ss php
The list of packages will include a number of packages that includes
PHP extensions such as php-gd,
php-intl, php-sqlite, and others.
When extensions are installed, additional packages
will be automatically installed as necessary to satisfy the dependencies
of those packages.
Ejemplo #4 Install PHP with GD
# pacman -S php-gd
After installing an extension package, the corresponding entry in
/etc/php/php.ini must be uncommented to enable it.
For example, after installing php-gd, uncomment the line
extension=gd in /etc/php/php.ini.
Restarting the web server (like Apache) is required before these
changes take effect.