(Last Updated On: January 11, 2019)

This is a walkthrough guide on installing PHP 7.3 on Arch Linux and Manjaro. PHP 7.3 has been released with plenty of new features, bug fixes, performance improvement, deprecations as well as new functionalities.

I have written guides for installing PHP 7.3 on Ubuntu, Debian and CentOS server but the missing piece was for Arch Linux and Manjaro. I use Arch Linux on my Laptop and today I want to install PHP 7.3 and extensions that I require into it.

How to install PHP 7.3 on Ubuntu 18.04 / Ubuntu 16.04

For CentOS 7 / Fedora, check out: How to Install PHP 7.3 on CentOS 7 / Fedora

For Debian 9 / Debian 8: How to Install PHP 7.3 on Debian 9 / Debian 8


Install PHP 7.3 on Arch Linux and Manjaro

We all know Arch Linux and Manjaro are rolling release Linux Distributions. This means its users often get latest software updates before users using non-rolling Linux distriubutions do. For this, the default version of PHP available on Arch Linux and Manjaro repositories is 7.3

To start, update your system

sudo pacman -Syu

Once the system is up-to-date, install PHP 7.3 by running the command.

$ sudo pacman -S php
resolving dependencies…
looking for conflicting packages…
Packages (1) php-7.3.0-1
Total Download Size: 3.42 MiB
Total Installed Size: 19.68 MiB
:: Proceed with installation? [Y/n] y
:: Retrieving packages…
php-7.3.0-1-x86_64 3.4 MiB 780K/s 00:04 [#####################################################] 100%
(1/1) checking keys in keyring [#####################################################] 100%
(1/1) checking package integrity [#####################################################] 100%
(1/1) loading package files [#####################################################] 100%
(1/1) checking for file conflicts [#####################################################] 100%
(1/1) checking available disk space [#####################################################] 100%
:: Processing package changes…
(1/1) installing php [#####################################################] 100%
:: Running post-transaction hooks…
(1/1) Arming ConditionNeedsUpdate…

Verify PHP version installed.

$ php -v 
PHP 7.3.0 (cli) (built: Dec 8 2018 12:11:20) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies

You can see from the output we have PHP 7.3.0 installed. If you’re doing this installation at a later date, the minor release version may differ.

Install PHP 7.3 Extensions

The extensions for PHP 7.3 can be installed by appending extension name to php-. See example below which install the basic PHP extensions I require for my development and applications hosting.

sudo pacman -S php-apache php-cgi php-fpm php-gd  php-embed php-intl php-imap  php-redis php-snmp

You can see package details using pacman -Qi

$ pacman -Qi php-fpm

Name : php-fpm
Version : 7.3.0-1
Description : FastCGI Process Manager for PHP
Architecture : x86_64
URL : https://secure.php.net/
Licenses : PHP
Groups : None
Provides : None
Depends On : php systemd
Optional Deps : None
Required By : None
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 12.67 MiB
Packager : Pierre Schmitz [email protected]
Build Date : Sat 08 Dec 2018 03:11:20 PM EAT
Install Date : Fri 11 Jan 2019 09:14:46 AM EAT
Install Reason : Explicitly installed
Install Script : No
Validated By : Signature

Enjoy your Development with PHP 7.3 on Arch Linux and Manjaro.

Reference: https://wiki.archlinux.org/index.php/PHP