how-to-install-laravel-valet-on-windows-10-properly-6013af7960b821611902841.jpeg

How to install laravel valet on windows 10 properly

Laravel

Subhadip Ghorui

3 years ago

Subhadip Ghorui

1. Install XAMPP

 

Download load xampp and install it. Change its apache server port (ex- 80 to 81). Because Laravel valet run on port 80.

Link:-https://www.apachefriends.org/download.html

 

Modify two lines

Listen 81

ServerName localhost:81

 

2. Install composer

 

Download and install composer. It will automatically detect php path of xampp.

Link:- https://getcomposer.org/download/

 

 

3. Download Laravel valet package bt cretueusebiu/valet-windows

 

GitHub:- https://github.com/cretueusebiu/valet-windows

Open terminal as administrator mode.

composer global require cretueusebiu/valet-windows

 

4. Install Valet

 

valet install

 

5. Config DNS

 

We need to configure Acrylic DNS proxy usage manually. So follow the below steps carefully:

Go to:

Settings->Network and Internet->Change Adapter option->Select your Network and Change properties.

Click on Internet Protocol version 4 (TCP/IPV4) -> edit DNS

Select use the following DNS server address. Add Following

127.0.0.1

8.8.8.8

Click ok.

Then go to Internet Protocol version 6 (TCP/IPV6) -> edit DNS

Select use the following DNS server address.

::1

Click ok.

 

6. Run valet command to valet directory

 

Then go to the directory where the Laravel valet is installed.

C:/Users/YOUR_USER_NAME/.config/valet

Open terminal or PowerShell as administrator. On Menu Bar File->Open Windows PowerShell-> Open Windows PowerShell as Administrator. Run-

valet

You see all commands used in the Laravel valet.

Run

valet services

If all services running that means you successfully install valet. If not run.

valet restart

You may face 502 Bad request.

Its because the php service may be stopped. Run-

valet services

To solve this problem you have to change the valet_phpcgi port from default 9001 to another(ex- 9002).

Go to C:\Users\Super Admin\.config\valet directory and edit config.json file. Change-

"php_port": 9002

 

Then uninstall valet and reinstall it. Do not delete any file or folder.

valet uninstall
valet install

Check services if they work properly. You should get this.

Try different port and the same steps until it works.

 

7. Park Project Directory

 

Go to the project directory where you save your projects. Open a terminal to that directory and run-

valet park

Now you can access the projects by their folder name. ex- your project folder is called laravel-shop(Your folder should not have space or _). Your domain name will be laravel-shop.test

For the list of all park directory run-

valet path

For Server restart

valet restart

For Secure Domain - open terminal as administrator on the parked directory, run-

valet secure laravel-shop

You will now have https://laravel-shop.test

For Unsecure it

valet unsecure laravel-shop

 

 

0 people like this
14488 views
1 comments
Share it on your social media account.

Please Sign in to post comments - Sing in or Register

1 Comments

shamim-zafar-rana601f150c7cc6c.jpg
Shamim Zafar Rana

Sat, 06 Feb 2021 22:17

Best Series to Learn Laravel