DEV Community

Shaikh Al Amin
Shaikh Al Amin

Posted on • Updated on

How to install PHP 8.2 and Laravel version 10 in Ubuntu

Install Ubuntu basic dependency:

sudo apt install curl software-properties-common ca-certificates lsb-release apt-transport-https
Enter fullscreen mode Exit fullscreen mode

Add all PHP repositories:

LC_ALL=C.UTF-8 sudo add-apt-repository ppa:ondrej/php
Enter fullscreen mode Exit fullscreen mode

Update the system:

sudo apt update
Enter fullscreen mode Exit fullscreen mode

Install PHP 8.2

sudo apt install php8.2
Enter fullscreen mode Exit fullscreen mode

Now install all PHP dependencies for Laravel version 10:

sudo apt install php8.2-curl openssl php8.2-bcmath php8.2-curl php8.2-mbstring php8.2-mysql php8.2-tokenizer php8.2-xml php8.2-zip php8.2-gd
Enter fullscreen mode Exit fullscreen mode

Now install composer:

curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
sudo chmod +x /usr/local/bin/composer
Enter fullscreen mode Exit fullscreen mode

Now create laravel project using composer:

composer create-project laravel/laravel test_laravel
Enter fullscreen mode Exit fullscreen mode

Top comments (0)