Download the PHP package ycodetech/valet-windows without Composer
On this page you can find all versions of the php package ycodetech/valet-windows. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package valet-windows
This is a Windows port of the popular Mac development environment Laravel Valet.
Laravel Valet Windows 3 is a much needed updated fork of cretueusebiu/valet-windows, with lots of improvements and new commands. This version hopes to achieve as much parity as possible with the Mac version. For command parity, please refer to the parity checker.
[!WARNING]
If you're coming from cretueusebiu/valet-windows, then you need to make sure to fully uninstall it from your computer, deleting all configs, and removing from composer with
composer global remove cretueusebiu/valet-windows
, before installing this 3.0 version.
Contributions
Commands Section | Installing/Uninstalling & Starting/Stopping | PHP Services | Multi-PHP Versions and Securing | Parked, Linked, Proxies and Sites | Sharing | Other Commands |
---|---|---|---|---|---|---|
Command | install | php:add | use | park | share | tld |
sudo | php:remove | isolate | parked | auth|set-ngrok-token | which | |
start | php:install | isolated | unpark|forget | url|fetch-share-url | paths | |
restart | php:uninstall | unisolate | link | ngrok | open | |
stop | php:list | secure | links | latest|on-latest-version | ||
uninstall | php:which | secured | unlink | log | ||
xdebug:install | unsecure | proxy | services | |||
xdebug:uninstall | proxies | directory-listing | ||||
unproxy | diagnose | |||||
sites | parity |
Introduction
Valet 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 Valet configures your Windows to always run Nginx in the background when your machine starts. Then, using Acrylic DNS, Valet proxies all requests on the *.test
domain (aka tld) to point to sites installed on your local machine.
This is 3.0 of Valet Windows, branded under the name Laravel Valet Windows 3, and is a much needed updated fork of cretueusebiu/valet-windows. It introduces lots of improvements, new commands, and hopes to achieve as much parity as possible with the original Mac version.
Services shipped with Valet
Valet ships with and installs these services:
Service | Version |
---|---|
Acrylic DNS Proxy | 2.1.0 |
Ansicon | 1.89 |
gsudo | 2.0.10 |
nginx | 1.19.5 |
ngrok | 3.3.1 |
[!IMPORTANT] ngrok may error out that it is "too old" when running it for some accounts. In the upcoming v3.2.0 release, Valet will ship with the latest version of ngrok.
In the meantime, you can update the ngrok executable manually by running
valet ngrok update
. This will directly update the executable to the latest version.Afterwards, you will need to run
valet ngrok config upgrade
to upgrade the config file to the latest format.For both commands, valet automatically appends the config file location as a flag to the command, so ngrok will already know where the config file is.
Installation
Before installation, make sure that no other programs such as Apache or Nginx are binding to your local machine's port 80. If XAMPP or similar is installed make sure they don't have Windows services installed and change their ports.
Also make sure to open your preferred terminal (Windows Terminal, CMD, Git Bash, PowerShell, etc.) as Administrator. You can use VS Code integrated terminal, but if VS Code isn't opened as Administrator, then a bunch of User Account Control (UAC) pop ups will appear in order to give access to Valet. You can also use a non Administrator terminal without the popups, you'll just need to use Valet's sudo
command before any other Valet commands.
[!NOTE]
Laravel Valet Windows 3 is developed and tested to run on Windows 10. In theory it should run on Windows 11 and up, but there's no guarantee. Testers and contributors are always welcome though.
-
If you don't have PHP installed, make sure to install it.
Download the Zip file and unzip into a directory of your choosing. The recommended directory is:
C:/php/
.You may use Thread Safe (TS), but Non-Thread Safe (NTS) is better for using PHP on the FastCGI protocol, which Valet uses.
For NTS binaries the widespread use case is interaction with a web server through the FastCGI protocol, utilizing no multithreading (but also for example CLI).
-
If you don't have Composer installed, make sure to install it.
-
Install Valet with Composer via
composer global require ycodetech/valet-windows
.[!WARNING]
If you're coming from cretueusebiu/valet-windows, then you need to make sure to fully uninstall it from your computer, deleting all configs, and removing from composer with
composer global remove cretueusebiu/valet-windows
, before installing this 3.0 version. -
Install Valet by running the
valet install
command, or alternativelyvalet sudo install
with administrator elevation. This will configure and install Valet and register Valet's daemon to launch when your system starts. Once installed, Valet will automatically start it's services. - If you're installing on Windows 10/11, you may need to manually configure Windows to use the Acrylic DNS Proxy.
Valet will automatically start its daemon each time your machine boots. There is no need to run valet start
or valet install
ever again once the initial Valet installation is complete.
Commands
For commands that are referenced as "the same as the Mac version", please refer to the official documentation on the Laravel website for more information.
Installing/Uninstalling & Starting/Stopping
install
This installs all Valet services:
- Nginx
- PHP CGI
- PHP Xdebug CGI [optional]
- Acrylic DNS
- Ansicon
And it's configs in C:/Users/Username/.config/valet
.
Once complete, Valet will automatically start the services.
[!NOTE]
If
install
is ran again when it's already installed, Valet will ask if you want to proceed to reinstall.
install --xdebug
--xdebug
is a boolean option to optionally install Xdebug for PHP. If the option is present, it's true
, otherwise false
.
sudo
sudo
is a Windows equivalent of the Mac command utilty of the same name, provided by gsudo. The command allows you to pass through Valet commands to gsudo, gsudo will then elevate the command to use the highest system administrator privileges, without the need for multiple User Account Control (UAC) popups...
gsudo only requires 1 UAC popup to enable elevation (per usage), and then the passed Valet command, it's arguments, values and options will be executed as the system with no further UACs.
valetCommand
valetCommand
is the Valet command, plus it's argument's values that you wish to run. It is a string array separated by spaces.
In the example above, isolate
is the command name and 7.4
is the argument value.
When specifying the Valet command, you can pass the valet
CLI keyword before the command as you would normally, but this is optional. If it's omitted, Valet will add it automatically. It's preferred to omit the keyword as it's cleaner.
--valetOptions
--valetOptions
(shortcut -o
) [optional] is the Valet options/flags for a Valet command. It is a string, but multiple options can be specified. Please see the important notes about this option.
start
This command is the same as the Mac version.
restart
This command is the same as the Mac version.
stop
This command is the same as the Mac version.
uninstall
This completely stops and uninstalls all of Valet's services.
You will also need to uninstall
Valet if you are wanting to update Valet via Composer (composer global update ycodetech/valet-windows
), just to make sure Composer can remove and update relevant files without error.
[!CAUTION]
If
composer global update
is ran before valet is uninstalled, then several running services may prevent composer from removing the files and updating valet.If this happens you can use the
emergency_uninstall_services.bat
file to stop and uninstall the services. See Emergency Stop and Uninstall Services section.
--force
--force
is to optionally force an uninstallation without Valet asking confirmation.
--purge-config
--purge-config
(shortcut -p
) is to optionally purge and remove all Valet's configs. This should be used if Valet is no longer required and it won't be installed again.
PHP Services
php:add
[!NOTE]
When adding PHP, the full version number (eg. 7.4.33) will be extracted and an alias (eg. 7.4) will be generated. Either of these can be used in other commands.
Furthermore, the details of the versions will be written to the config in a natural decending order that adheres to decimals. This means that when two minor versions (like 8.1.8 and 8.1.18) of an alias (8.1) are added, and the default PHP is then set to use the alias, then Valet will use the most recent version of the alias, which in this case would be 8.1.18.
[!TIP]
You may specify the path without quotes, but if the directory has spaces in like
C:/Program Files/php/7.4
then it must be surrounded in quotes. Otherwise valet will encounter an error.
php:add --xdebug
--xdebug
is a boolean option to optionally install Xdebug for the PHP being added. If the option is present, it's true
, otherwise false
.
php:remove
Both the full version and the alias version works:
--path
Instead of using the version number, you can specify the PHP by it's path.
[!NOTE]
If Xdebug is installed for the PHP being removed, then Valet will also remove Xdebug for that version too.
php:install
php:install
Installs the PHP CGI services for the versions listed in Valet with php:list
. If they are already installed, Valet uninstalls them first and then reinstalls them.
php:uninstall
php:uninstall
Uninstalls the PHP CGI services for the versions listed in Valet with php:list
.
php:list
List the PHP versions installed in Valet.
php:which
xdebug:install
xdebug:install
installs an Xdebug service for all PHP versions listed in Valet with php:list
.
Valet only installs an Xdebug PHP CGI service on a separate port to work along side the PHP CGI service, it doesn't install Xdebug itself. Please read the Xdebug Installation for further information.
You can optionally install Xdebug for one specific PHP version using the phpVersion
argument.
[!NOTE]
If Xdebug for the supplied PHP version is already installed, Valet will ask if you want it reinstalling.
xdebug:uninstall
You can optionally uninstall Xdebug for one specific PHP version using the phpVersion
argument.
Using PHP versions
use
[!NOTE]
If using the alias, and multiple versions of 8.1 are available eg. 8.1.8 and 8.1.18, then the most latest version will be used eg. 8.1.18.
isolate
[!TIP]
You can isolate 1 or more sites at a time. Just pass the
--site
option for each of the sites you wish to isolate to the same PHP version.
This command is the same as the Mac version.
isolated
This command is the same as the Mac version.
unisolate
unisolate --all
--all
is a boolean option to optionally unisolate all the currently isolated sites. If the option is present, it's true
, otherwise false
.
secure
Secures a site with a trusted self-signed TLS certificate and serves the site on the https
protocol.
[!TIP]
The secure command (or secure option in any other commands) need to be used in an admin privileged/elevated terminal. Either open a terminal as administrator or use the
sudo
command.
secured
This command is the same as the Mac version.
unsecure
Unsecures a site by removing it's TLS certificate and serves the site on the http
protocol.
unsecure --all
--all
is a boolean option to optionally unsecure all the currently secured sites. If the option is present, it's true
, otherwise false
.
This command is the same as the Mac version.
Parked, Linked, Proxies and Sites
park
park
registers a directory that contains all your sites to Valet. Once the directory has been parked
, Valet will automatically serve all sub-directories as sites, accessible in the web browser. They serve in the form of http://<directory-name>.test
To view all registered directories, use the paths
command.
Laravel Valet docs.
parked
[!NOTE]
If there's a parked site that is also a symbolic linked site, then it will also output the linked site name (aka alias) and it's URL (aka alias URL).
unpark|forget
To stop auto-serving sub-directories as sites, run the forget
command to forget
the directory.
unpark
is a command alias.
This command is the same as the Mac version.
link
link
is another way to serve directories as sites, except it serves one singular site in a directory rather than the whole directory. It does this by creating a symbolic link inside the ~/.config/valet/Sites
directory, of which is a parked
directory on Valet installation.
Serving the current working directory as a site:
name
If you wish to serve the site under a different name to that of the directory, just pass the optional name
argument. This is most useful if the directory has spaces in the name, Valet doesn't URL encode spaces or any other non-URL safe characters, so the site won't work without changing it.
--secure
--secure
option allows you to secure the site. It is boolean, so if it's present it's true
, otherwise false
.
--isolate
--isolate
option allows you to isolate the site to a specific PHP version. Pass it with a value.
Laravel Valet docs.
links
This command is the same as the Mac version.
unlink
unlink
removes the current working directory's (cwd) symbolic linked site. Valet will find the linked site name using the cwd name and delete the symbolic link from the ~/.config/valet/Sites/
directory.
name
name
specifies the name of the symbolic link.
[!NOTE]
If the linked site is
secured
, Valet will unsecure it before removing.[!NOTE]
If the linked site is
isolated
, Valet will unisolate it before removing.
This command is the same as the Mac version.
proxy
proxy
allows you to proxy
a Valet site to another service on your machine and send all traffic from the Valet site to the service.
You may also proxy multiple sites to 1 host by separating them with commas.
proxy --secure
--secure
option allows you to secure the proxy site. It is boolean, so if it's present it's true
, otherwise false
.
This command is the same as the Mac version.
proxies
This command is the same as the Mac version.
unproxy
Just like the proxy
command, you may unproxy multiple sites at once by separating them with commas.
This command is the same as the Mac version.
sites
Sharing
[!NOTE]
ngrok ships with Valet internally, there is no need to download it separately.
share
Share your local site publically. ngrok will do all the magic for you and give you a publically accessible URL to share to clients or team members.
Before sharing a site with ngrok, you must first set the authtoken using Valet's set-ngrok-token
command.
[!NOTE]
The public URL won't be displayed, however, in a separate terminal, you can use the
fetch-share-url
command to get the url and copy it to the clipboard.
share --options
--options
(shortcut -o
) [optional] is ngrok's options/flags for it's http
command (which valet share
uses internally). It is a string, but multiple options can be specified. Please see the important notes about this option.
auth|set-ngrok-token
auth
is a command alias.
Before sharing a site with ngrok, you must first set the authtoken, which can be accessed in your ngrok account.
This command is the same as the Mac version.
url|fetch-share-url
url
is a command alias.
Once sharing a site with valet share
, you can get the public URL using this command in a separate terminal. The URL will be outputted to the terminal and will also be copied to the clipboard for ease of use.
This command is the same as the Mac version.
ngrok
Because ngrok CLI has a multitude of commands and options, the valet ngrok
command is very useful for passing through any and all commands to ngrok.
ngrok commands
The commands
argument is a space-separated array of the commands plus it's argument's values.
ngrok --options
The --options
(shortcut -o
) [optional] can be used to pass options/flags to ngrok. It is a string, but multiple options can be specified. Please see the important notes about this option.
Other commands
tld
tld
gets the current Top Level Domain (TLD) that Valet is using.
When developing, you may like to use a different TLD. Valet serves sites on the default .test
TLD, but you can also set a different one with this command, just pass the new TLD as it's argument.
[!CAUTION]
When choosing a TLD, you need to be careful not to use one that could potentially be used on the Web. If your site name and TLD match a real web address, then the browser will resolve the request and redirect it to the real website instead of Valet resolving it to your local project.
Example: Your local Roots Bedrock site on
bedrock.dev
will redirect to the Minecraft Bedrock website.Generally, the special-use domains listed on Wikipedia, and any unique custom ones like
.code
, are all good to use as they are invalid TLDs.
This command is the same as the Mac version. Note: the Mac version has officially discontinued it's use; whereas Valet Windows 3 won't.
which
This command is the same as the Mac version.
paths
paths
allows you to view all registered paths. The default path is ~/.config/valet/Sites
, any others are added via the park
command.
This command is the same as the Mac version.
open
This command is the same as the Mac version.
latest|on-latest-version
latest | on-latest-version Determine if this is the latest version/release of Valet
latest
is a command alias.
$ valet on-latest-version
$ valet latest
Yes
on-latest-version
determines whether the installed version of Valet is the latest. If not, then Valet will prompt you to update.
This command is the same as the Mac version.
log
log View and follow a log file
[key] The name of the log
[-l|--lines] The number of lines to view
[-f|--follow] Follow real time streaming output of the changing file
$ valet log nginx --lines=3 --follow
$ valet log nginx -l 3 -f
log
allows you to view the logs which are written by Valet's services. To view a list of logs, simply run valet log
.
$ valet log
┌───────────────────────┬───────────────────────────────────────────────────────────────┐
│ Key │ File │
├───────────────────────┼───────────────────────────────────────────────────────────────┤
│ nginx │ C:/Users/Username/.config/valet/Log/nginx-error.log │
├───────────────────────┼───────────────────────────────────────────────────────────────┤
│ nginxservice.err │ C:/Users/Username/.config/valet/Log/nginxservice.err.log │
├───────────────────────┼───────────────────────────────────────────────────────────────┤
│ nginxservice.out │ C:/Users/Username/.config/valet/Log/nginxservice.out.log │
├───────────────────────┼───────────────────────────────────────────────────────────────┤
│ nginxservice.wrapper │ C:/Users/Username/.config/valet/Log/nginxservice.wrapper.log │
├───────────────────────┼───────────────────────────────────────────────────────────────┤
│ phpcgiservice.err │ C:/Users/Username/.config/valet/Log/phpcgiservice.err.log │
├───────────────────────┼───────────────────────────────────────────────────────────────┤
│ phpcgiservice.out │ C:/Users/Username/.config/valet/Log/phpcgiservice.out.log │
├───────────────────────┼───────────────────────────────────────────────────────────────┤
│ phpcgiservice.wrapper │ C:/Users/Username/.config/valet/Log/phpcgiservice.wrapper.log │
└───────────────────────┴───────────────────────────────────────────────────────────────┘
The key
is required in order to view a log. It can be found from the list of logs.
--lines
The --lines
(shortcut -l
) option changes the number of lines to view from the log.
$ valet log nginx --lines=3
$ valet log nginx -l 3
--follow
The --follow
(shortcut -f
) option can be used to follow real time streaming output of the changing file.
$ valet log nginx --follow
$ valet log nginx -f
[!TIP]
--follow
is set to stream output "forever" (though one can never be too sure if it actually is forever). To stop the output stream, you need to pressctrl+C
.
This command is the same as the Mac version.
services
services List the installed Valet services
$ valet services
Checking the Valet services...
┌───────────────────┬────────────────────────────────┬───────────────┐
| Service | Windows Name | Status |
├───────────────────┼────────────────────────────────┼───────────────┤
| acrylic | AcrylicDNSProxySvc | running |
├───────────────────┼────────────────────────────────┼───────────────┤
| nginx | valet_nginx | running |
├───────────────────┼────────────────────────────────┼───────────────┤
| php 8.1.8 | valet_php8.1.8cgi-9001 | running |
├───────────────────┼────────────────────────────────┼───────────────┤
| php 7.4.33 | valet_php7.4.33cgi-9002 | running |
├───────────────────┼────────────────────────────────┼───────────────┤
| php-xdebug 8.1.8 | valet_php8.1.8cgi_xdebug-9101 | not installed |
├───────────────────┼────────────────────────────────┼───────────────┤
| php-xdebug 7.4.33 | valet_php7.4.33cgi_xdebug-9102 | running |
└───────────────────┴────────────────────────────────┴───────────────┘
directory-listing
directory-listing Determine directory-listing behaviour. Default is off, which means a 404 will display
[status] Optionally, switch directory listing [on, off]
$ valet directory-listing
Directory listing is off
$ valet directory-listing on
Directory listing setting is now: on
This command is the same as the Mac version.
diagnose
diagnose Output diagnostics to aid in debugging Valet.
[-p|--print] Optionally print diagnostics output while running
[--plain] Optionally print and format output as plain text (aka, pretty print)
$ valet diagnose
Running diagnostics...
[Diagnostics output here]
The diagnostics will be copied to the clipboard as formatted HTML for easy issue reporting.
This command is the same as the Mac version.
parity
parity Output the calculation of the percentage of parity completion against Laravel Valet (macOS) of a specific version.
$ valet parity
Out of a total 39 commands, 36 are possible for parity, with 34 complete, and 11 brand new commands.
Parity at 87% out of a total 92% possible parity with the Laravel Valet (macOS) v4.3.0
This command is a way to determine how much parity has been achieved.
Notes for all --options
These are important notes for the commands that have the --options
or --valetOptions
.
-
The
--options
,--valetOptions
(shortcut-o
) options can be used to pass options/flags to the service related to that command.Just pass the option name without the
--
prefix eg.--options=config=C:/path/ngrok.yml
(example for thengrok
command). This is so that Valet doesn't get confused with it's own options.All options/flags that are passed will be prefixed with
--
after Valet has processed the command, unless it's a shortcut of a single character, then it will be prefixed with-
. The example above will run as--config=C:/path/ngrok.yml
. -
The
=
immediately after the command option is optional, if it's omitted, you must use a space instead.--options=option1 --options option1 --valetOptions=option1 --valetOptions option1
-
The options also have
-o
shortcuts and it cannot have the=
character, it must use a space for separation.-o option1
This falls inline with Symfony's docs and complies with command-line standards.
From Symfony's docs:
Note that to comply with the docopt standard, long options can specify their values after a whitespace or an
=
sign (e.g.--iterations 5
or--iterations=5
), but short options can only use whitespaces or no separation at all (e.g.-i 5
or-i5
). -
The options also allows multiple options to be passed, they just need to be separated with double slashes
//
.--valetOptions=option1//option2//option3 --options option1//option2//option3 -o option1//option2//option3
Command Parity Checker
Commands that have been tested and made parity:
- [ ] composer - not applicable
- [x] diagnose
- [x] directory-listing
- [x] fetch-share-url
- [x] forget
- [x] install
- [x] isolate
- [x] isolated
- [x] link
- [x] links
- [x] log
- [ ] loopback - not applicable
- [x] on-latest-version
- [x] open
- [x] park
- [x] parked
- [x] paths
- [ ] php (proxying commands to PHP CLI) - Possible far future feature?
- [x] proxies
- [x] proxy
- [x] restart
- [x] secure
- [x] secured
- [x] set-ngrok-token
- [x] share
- [ ] share-tool - Next feature drop
- [x] start
- [x] status - renamed to
services
- [x] stop
- [x] tld
- [ ] trust - not applicable
- [x] uninstall
- [x] unisolate
- [x] unlink
- [x] unproxy
- [x] unsecure
- [x] use
- [x] which
- [x] which-php - renamed to
php:which
To see a calculation of how much parity has been achieved, see the parity command.
Deprecations and Removals
Deprecated | Since Version | Will be Removed in Version | Removed? | The `install` command confirmation question about uninstalling the outdated cretueusebiu package. Doesn't affect valet functionality. | 3.1.0 | 3.2.0 | ✗ |
---|