progrez.cloud

Cara Install PHP 8 di Ubuntu 20.04

26 Juli 2021

Install Dependencies

$ sudo apt update
$ sudo apt upgrade
$ sudo apt install ca-certificates apt-transport-https software-properties-common


Add Repository PHP

$ sudo add-apt-repository ppa:ondrej/php

# LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
 More info: https://launchpad.net/~ondrej/+archive/ubuntu/php
Press [ENTER] to continue or Ctrl-c to cancel adding it.


// Tekan Enter


Update Repository

$ sudo apt update


Install PHP Component

$ sudo apt install php8.0 libapache2-mod-php8.0


Config Apache

$ sudo systemctl restart apache2
$ sudo apt install php8.0-fpm libapache2-mod-fcgid
$ sudo a2enmod proxy_fcgi setenvif
$ sudo a2enconf php8.0-fpm
$ sudo systemctl restart apache2


Check PHP Installation

$ php --version

PHP 8.0.8 (cli) (built: Jul 1 2021 15:26:46) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.8, Copyright (c) Zend Technologies
   with Zend OPcache v8.0.8, Copyright (c), by Zend Technologies


End