laracodedeveloper/laraserve-windows

A more enjoyable local development experience for Windows.

v1.0 2020-09-21 17:30 UTC

This package is auto-updated.

Last update: 2024-03-22 04:35:40 UTC


README

Laraserve is a Laravel development environment for Windows. No Vagrant, no /etc/hosts file. You can even share your sites publicly using local tunnels. Yeah, we like it too.

Laravel Laraserve configures your Windows to always run Nginx in the background when your machine starts. Then, using Acrylic DNS, Laraserve proxies all requests on the *.test domain to point to sites installed on your local machine.

Documentation

Before installation, make sure that no other programs such as Apache or Nginx are binding to your local machine's port 80.
Also make sure to open your preferred terminal (CMD, Git Bash, PowerShell, etc.) as Administrator.

  • If you don't have PHP installed, open PowerShell (3.0+) as Administrator and run:
# PHP 7.4
Set-ExecutionPolicy RemoteSigned; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -Uri "https://github.com/laracodedeveloper/laraserve-windows/raw/master/bin/php74.ps1" -OutFile $env:temp\php74.ps1; .$env:temp\php74.ps1

# PHP 7.3
Set-ExecutionPolicy RemoteSigned; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -Uri "https://github.com/laracodedeveloper/laraserve-windows/raw/master/bin/php73.ps1" -OutFile $env:temp\php73.ps1; .$env:temp\php73.ps1

This script will download and install PHP for you and add it to your environment path variable. PowerShell is only required for this step.

  • If you don't have Composer installed, make sure to install it.

  • Install Laraserve with Composer via composer global require laracodedeveloper/laraserve-windows.

  • Run the laraserve install command. This will configure and install Laraserve and register Laraserve's daemon to launch when your system starts.

  • If you're installing on Windows 10, you may need to manually configure Windows to use the Acrylic DNS proxy.

Laraserve will automatically start its daemon each time your machine boots. There is no need to run laraserve start or laraserve install ever again once the initial Laraserve installation is complete.

Known Issues

  • When sharing sites the url will not be copied to the clipboard.
  • You must run the laraserve commands from the drive where Laraserve is installed, except for park and link.
  • If your machine is not connected to the internet you'll have to manually add the domains in your hosts file or you can install the "Microsoft Loopback Adapter" as this simulates an active local network interface that Laraserve can bind too.

Laraserve park or link folder

  • You have to run all the Laraserve commands that restart a service from the C drive (eg: laraserve install, laraserve start, laraserve restart, laraserve stop).
  • But you can still run laraserve park folder / laraserve link folder from the D drive but if you want to secure a domain you'll have to run laraserve secure some-site from the C drive.

Useful Links