How to Install PHP Laravel Framework

PHP Laravel Framework Basics Part-3: How to Install PHP Laravel Framework?

Laravel 9 Installation

Laravel 9 Installation

To install PHP Laravel Framework, you must have PHP, MySql, Apache/nginx installed on your Linux or Windows server. In addition, your PHP Server should have the following extensions with the new version of PHP:

  • PHP >= 8.0
  • BCMath PHP Extension
  • Ctype PHP Extension
  • cURL PHP Extension
  • DOM PHP Extension
  • Fileinfo PHP Extension
  • JSON PHP Extension
  • Mbstring PHP Extension
  • OpenSSL PHP Extension
  • PCRE PHP Extension
  • PDO PHP Extension
  • Tokenizer PHP Extension
  • XML PHP Extension

And Composer must be installed to manage Laravel Framework’s dependencies. If you have Windows machine, you can install Composer from this link If you have a Linux or Unix machine, type the following command in the terminal:

sudo apt install composer

If all our requirements including composer are installed, now we will see the Laravel Installation step by step, let’s see the steps and install :

First step: First check if your composer is running? For this you have to write composer and press enter. If running then the result will be as below :

Windows Output:

composer running on windows

Linux Output:

composer running on linux

Second step: This time navigate to the drive where you will install laravel project. Then enter the following command:

composer create-project laravel/laravel your-project-name

Here you have to give your project name instead of your-project-name. Here we named w3programmers: see below screenshot :

laravel installation

laravel installation

Step 3: Now you need to navigate to your project folder and run the following command.

php artisan serve

See the screenshot below :

PHP Artisan Serve

Step 4: Now you need to go to any of your browsers and enter http://127.0.0.1:8000/ day You will get output like below screenshot :

PHP Laravel Installation Success

Install PHP Laravel Framework

Leave a Reply

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