How to Install Laravel on Localhost XAMPP

To install laravel on localhost you should install XAMPP on your computer. Laravel needs the Composer program to manage its extensions.

Updated: 23 Dec, 22 by linda Y 2 Min

How to Install Laravel on Localhost XAMPP

First, you should install XAMPP on your computer. To install different versions of Laravel, the PHP version of your XAMPP program is very important.

To install Laravel, version 5.7, you need the following specifications:

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

BCMath PHP Extension

If you have a lower version of PHP, you should upgrade it.

Laravel needs the Composer program to manage its extensions. If you do not have this program, you can download it from the site of Laravel or via the website getcomposer.org.

install-composer

composer-install2

After downloading Composer.exe, run it in the installation process. If you are prompted for the php.exe path, its address in your system is xampp/php by default.

If the composer is installed correctly, you'll see the below picture by entering the composer command in cmd.

composer2

To install Laravel on the localhost, type the below command in cmd.

C:\> cd xampp

C:\ xampp>cd htdocs

xampp

Now in the corresponding path, enter the following command to create a new Laravel project:

Composer create-project --prefer-dist laravel/laravel new_project

Now, Laravel is being installed on your system. After installation, go to the new_project folder and execute the php artisan serve command.

C:\ xampp\ htdocs > Cd new_project

C:\ xampp\ htdocs \ new_project >php artisan serve

php

A new message will be displayed on the server and your work on cmd will be completed.

Just open your browser and enter one of the addresses below.

http://127.0.0.1:8000

http: // localhost / new_project / public

At this moment, your new Laravel project will be successfully installed and run.

laravel2

Also, you can read about Installing Laravel on cPanel web hosting through SSH in this Article
linda Y

linda Y

My name is Linda, I have Master degree in Information Technology Engineering. I have some experiences in working with Windows and Linux VPS and I have been working for 2 years on Virtualization and Hosting. 

user monovm

Marcel

2019, Sep, 19

Thanks for this article was really helpful. What if I want to create subsequent projects, do I still have to run the same command 'Composer create-project --prefer-dist laravel/laravel new_project' and be connected to the internet while doing that or can I do another way

user monovm

Nimesh

2020, Feb, 20

Thank you!

user monovm

Steve

2020, Apr, 20

This was so simple and helpfull. Thank you!!

user monovm

ANAND

2020, Apr, 20

Thank you very much for this simple and workable solution

user monovm

gopinath

2020, May, 20

How do you deploy the laravel in windows server(hosted server). Inside the server(local) I can run in both way. http://127.0.0.1:8000 http: // localhost / new_project / public But using public url I can only able to run with this method "http: // example.com/ new_project / public" not with "http: // example.com:800". Could please share the reason?

user monovm

Cristian

2020, Jun, 20

I assume when you run it in your local as http://127.0.0.1:8000 you first execute the command php artisan serve. So when you are in a public url, have you configured your server and you run the same command?

user monovm

Lovette

2020, May, 20

Thanks. It worked like magic

user monovm

Susith Nonis

2020, Jun, 20

Happy to hear that!!

user monovm

mike

2020, Jun, 20

Aru u stupid? This has nathing todo with xampp. U r serving it with artisan.

user monovm

Shiro

2020, Jun, 20

Hey, Is it possible to enter the/your Laravel Local host from another machine in the/your same network envoriment?

user monovm

Joseph

2020, Jul, 20

you try too mush, thanks. works for me just simple

user monovm

Antoniy Yushkevych

2020, Jul, 20

We are glad you found this article useful :)

user monovm

luis barrera

2020, Aug, 20

Mejor explicado imposible.. gracias monovm , aca desde la tiera de shakira.. ahora aprender a usar lavare

user monovm

PhillipS

2021, Mar, 21

Thank you, I am also stupid. I followed the Screens and nothing worked. I started XAMPP/Apache (8.03) on Win10 and it worked. I also did "phpinfo()" and it worked. No need to fireup "php artisan serve" in my opinion.

user monovm

kumanan

2021, May, 21

the xampp got error how can i slove it

user monovm

Antoniy Yushkevych

2021, May, 21

Thank you for your question, most likely, you will need to do the following:

  1. Ensure that your user account has administrator privilege.
  2. Disable UAC (User Account Control) as it restricts certain administrative functions needed to run a web server.

To Disable UAC, do this:

  • type UAC into the Windows search bar and click on "Change User Account Control settings"
  • In the opened window, slide the bar all the way down to "Never Notify".
  • Click on "OK" to save the changes.

 

user monovm

luckily not mike

2021, May, 21

well mike, if you paid attention you could see that laravel indeed get installed onto xampp files.

user monovm

Shihab

2021, Jun, 21

Worked smoothly. Thanks a lot

user monovm

Emmanuel

2021, Sep, 21

This http://127.0.0.1:8000 worked But this http: // localhost / new_project / public didn't work Can you help ?

user monovm

Prof. Dandre Simonis Jr.

2024, Jul, 24

Thanks for the detailed guide on installing Laravel on XAMPP! It's super helpful, especially with the step-by-step instructions and images. I appreciate the clarity on the PHP extensions needed and the Composer setup. This will definitely make it easier for beginners to get started with Laravel on their local machines. Keep up the great work!