Install Laravel / Composer on Ubuntu 24.04

Install Laravel / Composer on Ubuntu 24.04

Laravel is a framework for PHP. It is popular and well-known for being easy to use and effective when creating web-based applications. It enables contemporary features and technologies to simplify development, such as database administration.

The necessary steps to install Laravel on an Ubuntu 24.04 machine are outlined in this technical guide. If you are running an older version, such as Ubuntu 22.04, see this article.

How to install Laravel on Ubuntu 24.04?

To install Laravel on your Ubuntu 24.04 PC, follow the instructions below.

Step 1: Make System File Updates and Upgrades

Updating and maintaining your system is a smart idea. This will enable your system to function easily and effectively:

sudo apt update
word image 11424 1

You can use the upgrade command if your system needs to install the most recent files for the installed packages:

sudo apt upgrade -y
word image 11424 1 1

You can start the installation procedure after your Ubuntu 24.04 computer has been set up with the most recent package files.

Step 2: Install the “Curl” package in step two.

Installing the “Curl” program with the following command is necessary in order to download the packages from the internet:

sudo apt install curl -y
word image 11424 1 2

The aforementioned warning will appear on your screen if the curl program has been installed on your computer.

Step 3: Installing the PHP package is step three.

PHP and related extensions are needed for Laravel. Use the command below to install these necessary files:

sudo apt install php php-common php-gd php-mysql php-curl php-intl php-mbstring php-bcmath php-xml php-zip
word image 11424 1 3 1
word image 11424 1 4 1

As can be seen from the output above, the command was successfully executed, and your Ubuntu 24.04 system now has all the necessary packages installed.

Step 4: Verify the installation of PHP

Use the following code to see the installed version of PHP after the PHP packages have been installed:

php -v
word image 11424 1 5

The output shows that the version of PHP that is presently installed on your Ubuntu 24.04 system is 8.3.6.

Step 5: Install Laravel and PHP Composers

Running the Laravel package on your computer requires this step. To download and install the composer package on your Ubuntu 24.04 computer, use the command below:

sudo curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/bin --filename=composer
word image 11424 1 6

Composer 2.7.6 is now successfully installed on your machine without encountering any errors.

Step 6: Verify Composer Installation

You can use the “composer” command followed by the “-v” option to verify the installed version of the Composer package:

composer -v
word image 11424 1 7

Thank You.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *