Laravel is most popular framework of PHP. It provides lots of in-build tools and library to build the web application. Laravel is used to to create robust custom web applications with ease of amazing developer experience.
Laravel is easily customizable and provides tools like ORM, Validation libraries, Queue, Mail, Routing, Schedulers, Views engines and Model view controller architecture.
Installing Laravel using composer
To install the Laravel using the composer there is few requirements which are below:
# Requirements:
- PHP 5.3.2+ for Laravel >= 5
- Php > 7.2.5 for Laravel 8
- BCMath PHP Extension
- Ctype PHP Extension
- Fileinfo PHP extension
- JSON PHP Extension
- Mbstring PHP Extension
- OpenSSL PHP Extension
- PDO PHP Extension
- Tokenizer PHP Extension
Read how to install extensions and php and What is composer and how to install composer?.
After checking the requirements, now we can start the installation.
First step is to open the command line in windows or terminal in Ubuntu and go to the folder where you want to install the Laravel. Most probably the directory of web server (var/www/html or htdocs)
$ composer create-project laravel/laravel example-app
here, example-app
is the name of project.
This will show result as below
Getting error like below
ERROR
PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted
then change composer memory limit and run composer update in example-app
COMPOSER_MEMORY_LIMIT=-1 composer update
And the directory structure after installation
Check the installation in browser by opening URL http://domain_ip/example-app/public