Install PHP 8

Add repository:

sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list
sudo apt update

Install PHP 8.0 with command line interface (CLI):

sudo apt install -y php8.0-common php8.0-cli

Add additionally modules to support DBs, mbstring, etc.

sudo apt install -y php8.0-curl php8.0-gd php8.0-mbstring php8.0-xml php8.0-zip php8.0-mysqli # php8.0-pgsql if it's installed

Add Appache mod and restart the server

sudo apt install -y libapache2-mod-php8.0
sudo service apache2 restart

Install/Upgrade Composer on Raspberry OS

To install/upgrade the Composer:

  • make sure you are in the home directory (cd ~)
  • download the installer
  • [optional] verify the installer (the line is commented, check the current hash from the Composer website)
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
# php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

(more…)

Yandex.Metrica