Laravel installation requirements
Before you can install Laravel, you need to make sure that your server meets some requirements. However, to save yourself from the trouble, you can go for Laravel Homestead virtual machine which fulfills all the prerequisites. But if you want to opt otherwise, here are the criteria that your server has to meet: -
PHP >= 7.2.5
BCMath PHP Extension
Ctype PHP Extension
Fileinfo PHP extension
JSON PHP Extension
Mbstring PHP Extension
OpenSSL PHP Extension
PDO PHP Extension
Tokenizer PHP Extension
XML PHP Extension
How do I set up Laravel?
There are many ways to install Laravel. But to keep it simple, we are going to install it with the composer.
The first step is to download the Laravel installer using composer.
composer global require laravel/installer
Now you have to ensure to place Composer’s system-wide vendor bin directory in your $Path. It exists in different locations based on your OS. Here are the common locations: -
macOS:
$HOME/.composer/vendor/bin
Windows:
%USERPROFILE%\\AppData\\Roaming\\Composer\\vendor\\bin
GNU / Linux Distributions:
$HOME/.config/composer/vendor/bin
or$HOME/.composer/vendor/bin
Once the installation is complete, you can use laravel new
command to create a new Laravel installation in your specified directory. For example, laravel new blog
will create a directory named blog
containing a fresh Laravel installation.