Many people confused how to download and install the Laravel framework in there machines because the download the option/button is not available in the official website so its very painful to download the Laravel (if you are new), but believe me its very easy to download and configure Laravel but before downloading lets take a look on larval.
Laravel is a PHP framework and according to me its the king in the PHP world, It has many cool features to save you time like Eloquent ORM, Routing, Middlewares and it has its own templating engine. But before downloading you must have the following requirements.
- PHP >= 7.1.3
- OpenSSL PHP Extension
- PDO PHP Extension
- Mbstring PHP Extension
- Tokenizer PHP Extension
- XML PHP Extension
- Ctype PHP Extension
- JSON PHP Extension
So download the composer and install it in your local environment, Now open your command prompt and type the code listed bellow.
composer create-project –prefer-dist laravel/laravel blog
Now, wait for few mints because it takes 4 to 7 mints its depend on your internet and your PC speed.
Once the downloading completed go to your project folder which we have defined above blog and type php artisan server
Go to your browser and type this code http://127.0.0.1:8000/
In this way, you can download the Laravel and install it in your local machine but wait if you want to execute the laravel setup in your server XAMPP or WAMP then just follow the bellow instruction.
So we have installed the Laravel framework inside our c:/ folder just copy the folder and past it inside your xampp/htdocs folder.
Now go to your xampp/apache/conf/extra/httpd-vhosts.conf and open the file httpd-vhosts.conf and paste this code in the last, make sure i have installed my xampp inside my c drive.
<VirtualHost *:80> DocumentRoot "c:/xampp/htdocs" ServerName localhost </VirtualHost> <VirtualHost *:80> DocumentRoot "c:/xampp/htdocs/blog/public" ServerName laravel.test </VirtualHost>
Now go to your search console and type notepad and right-click on the notepad icon and chose Run as administrator
Once you open the notepad as administrator type ctrl+o OR you can go to file and select open, go to your c:/Windows/System32/drivers/etc and open the, etc file make sure it will not show you anything just select All Files
Now past this code in the last line.
127.0.0.1 localhost ::1 localhost 127.0.0.1 laravel.test
Save the file and restart your server (xampp) and go to your browser and type laravel.test
Installing Laravel is the hard process if you are not familiar with Laravel or you are new and if you want to run Laravel inside your server environment i.e XAMPP or WAMP then you have to make extra changes in server files and as well windows files. By changing the files we can execute our Laravel projects inside our server.