|
Installing from packages on Arch LinuxWhile PHP can be installed from source, it is also available through packages on Arch Linux and derivatives that use pacman. Warning
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 » the official download area. The packages can be installed using the pacman command. Installing packages
First, note that other related packages may be desired, such as
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. Example #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: Example #2 Restarting Apache once PHP is installed # systemctl restart httpd Better control of configurationIn the last section, PHP was installed with only core modules. It is very likely that additional modules will be desired, such as These may also be installed via the pacman command.Example #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 Example #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 |