How To install Laravel 9 Via Composer/Installer

The laravel 9 has been launched on January 2022. This quick tutorial help to install Laravel 9 into your system. It’s too easy and simple as like previous laravel 8 version.

Laravel 9 has many features that continue the improvements. There is a variety of other bug fixes and usability improvements.

There is a number of ways to install laravel 9 into your system, You can use Laravel-installer or composer to install laravel.

You can also use homestead version of laravel, it’s a virtual machine. You can use Homestead as your local Laravel development environment.

Please make sure your server meets the following requirements:

  • PHP >= 7.2.0
  • BCMath PHP Extension
  • Ctype PHP Extension
  • JSON PHP Extension
  • Mbstring PHP Extension
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Tokenizer PHP Extension
  • XML PHP Extension

By Laravel Installer

First, download the Laravel installer using Composer, The vendor bin directory path for windows is – %USERPROFILE%\AppData\Roaming\Composer\vendor\bin.

composer global require laravel/installer

Once, The installer has been successfully installed, Please use laravel new command, which will create a fresh Laravel installation in the directory you specify.
laravel new crud-example

The above command will create a directory named crud-example containing a fresh Laravel installation with all of Laravel’s dependencies.

Via Composer To Install Laravel 9

You can also use composer to install laravel 9. We will use composer create-project command in your terminal as like below –
composer create-project --prefer-dist laravel/laravel crud-example

We can use php artisan command for PHP’s built-in development server to serve your application,

php artisan serve

The above command will start a development server at http://localhost:8000.

Create a Virtual Host in XAMPP

Let’s create a virtual host for this Laravel project, Open the Apache httpd-vhosts.conf file which is located in D:\xampp\apache\conf\extra\httpd-vhosts.conf, Added below lines of code at the end of the file.

    DocumentRoot "D:/xampp/htdocs/crud-example/public"

Now, Open the hosts file which is located at C:\Windows\System32\drivers\etc\hosts, added the below code into this file at the end.

restart the xampp server.

Let’s open the browser and navigate, Hopefully, You will get a welcome page of laravel.

How To Check The Laravel Version?

There are two ways to check the version of your Laravel application with Laravel. The first simple method is running a command on the command line to check the Laravel version. The second method is to look in the files for the Laravel version.

Let’s open your terminal or CLI and go to your project root directory and run the command for the check the laravel.

Leave a Reply

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