Categories: Development

Installing PHP 7.4 Beta4 on Ubuntu 18.04

Installing the new PHP 7.4 Beta 4 on an Ubuntu 18.04 server, 7.4 Beta4 was released on the 22nd of August 2019.

Start by updating package lists and information

sudo apt-get update

Next install apache and basic PHP module, which should be PHP version 7.3

sudo apt-get install apache2 php libapache2-mod-php

For 7.4 we will need to add a third party repository to download and install from, this is done like so:

apt-get install software-properties-common

add-apt-repository ppa:ondrej/php

apt-get update

Now PHP version 7.4 can be installed, this will do the latest release (Beta4):

sudo apt install php7.4-fpm

Time to switch the versions, from 7.3 to 7.4 and then restarting apache:

sudo a2dismod php7.3

sudo a2enmod php7.4

sudo service apache2 restart

Create a simple phpinfo() page to view the details…

<?php
phpinfo();

Which will among other things show you have PHP 7.4

Share

Recent Posts

Kennington reservoir drained drone images

A drained and empty Kennington reservoir images from a drone in early July 2024. The…

2 years ago

Merrimu Reservoir drone images

Merrimu Reservoir from drone. Click images to view larger.

2 years ago

Early September spring shots

Some early September spring shots from a bushwalk, It is still too early for wildflowers.

3 years ago

Cloning an NVMe to SK Hynix Platinum P41 NVMe

I recently needed to clone over a smaller NVMe to a 2TB SK Hynix Platinum…

3 years ago

Using Laravel’s deleteDirectory to delete folders and their contents

If you ever needed a simple solution in Laravel to delete an entire directory and…

3 years ago

How to allow only 1 user to register in a Laravel application

How to enforce only one user to register or be registered in a Laravel web…

3 years ago