Guide written from this documentation.
You are recommended to run Ubuntu 22.04.1 LTS in a VM. Choose either sulution for running a VM:
- Hyper-V for Windows Pro/Education/Enterprise hosts.
- Virtual Box cross-platform.
- VMWare cross-platform.
Update you apt repository and install php.
$ sudo apt update
$ sudo apt install php8.1 php8.1-common
Make sure that your php version is 8.0.0 =< version < 9.0.0
.
$ php -v
PHP 8.1.12 (cli) (built: Oct 28 2022 17:39:57) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.12, Copyright (c) Zend Technologies
with Zend OPcache v8.1.12, Copyright (c), by Zend Technologies
Once you made sure that yout php version is correct, install these php extension; BCMath
, Ctype
, JSON
, Mbstring
, OpenSSL
, PDO
, Tokenizer
and XML
.
$ sudo apt install php8.1-bcmath php8.1-ctype php8.1-json php8.1-mbstring php8.1-tokenizer php8.1-xml
Make sure that your php extensions are installed with:
$ php --modules