Downloading and installing the Laravel via composer in windows

Downloading laravel

Many people confused on how to download and install the Laravel framework in their machines because they download the option/button is not available on the official website.

So it’s harrowing to download the Laravel (if you are new), but believe me, it’s straightforward to download and configure Laravel, but before downloading, let’s take a look at larval.

Laravel is a PHP framework, and in my opinion, 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 templating engine. But before downloading, you must have the following requirements.

  • Composer
  • 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 below.

composer create-project –prefer-dist laravel/laravel blog

Now, wait for few mints because it takes 4 to 7 mints its depends 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 below 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 choose 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

 

 

Conclusion

Installing Laravel is a complicated process if you are not familiar with Laravel, or you are new. If you want to run Laravel inside your server environment, i.e., XAMPP or WAMP, then you have to make other changes in server files and as well windows files. By changing the files, we can execute our Laravel projects inside our server.

shakzee
administrator
My Name is Shehzad Ahmed and I am a full-time developer with over 7+ years of experience. In that time, I’ve worked as a developer with many big and small firms and was teaching web design and development skills to many keen learners and by the time passes I’ve found a great passion and potential on myself as a teacher on this particular field and now I am a full-time teacher and working as a freelancer.

Leave a Reply

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

Featured Courses

Learn Web Development and web designing in few months from shakzee with real-world experience. Get up to 80% discount!