1. Go to this page and download the library: Download ycodetech/valet-windows library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ycodetech / valet-windows example snippets
console
$ valet php:add "C:\php\7.4"
PHP 7.4.33 from C:\php\7.4 has been added.
console
$ valet php:add "C:\php\7.4" --xdebug
Installing Xdebug for 7.4.33...
PHP 7.4.33 from C:\php\7.4 has been added.
console
$ valet php:remove 7.4.33
$ valet php:remove 7.4
PHP 7.4.33 from c:\php\7.4 has been removed.
console
$ valet php:remove --path="C:\php\7.4"
PHP 7.4.33 from c:\php\7.4 has been removed.
php:install Reinstall all PHP services from [valet php:list]
console
$ valet php:install
Reinstalling PHP services...
php:uninstall Uninstall all PHP services from [valet php:list]
console
$ valet php:uninstall
Uninstalling PHP services...
console
$ valet php:list
Listing PHP services...
┌─────────┬───────────────┬────────────┬──────┬─────────────┬─────────┐
| Version | Version Alias | Path | Port | xDebug Port | Default |
├─────────┼───────────────┼────────────┼──────┼─────────────┼─────────┤
| 8.1.8 | 8.1 | C:\php\8.1 | 9006 | 9106 | X |
├─────────┼───────────────┼────────────┼──────┼─────────────┼─────────┤
| 7.4.33 | 7.4 | C:\php\7.4 | 9004 | 9104 | |
└─────────┴───────────────┴────────────┴──────┴─────────────┴─────────┘
php:which Determine which PHP version the current working directory is using
[site] Optionally, specify a site
console
$ valet php:which
The current working directory site1 is using PHP 7.4.33 (isolated)
The executable is located at: C:/php/7.4/php.exe
$ valet php:which site2
The specified site site2 is using PHP 8.1.8 (default)
The executable is located at: C:/php/8.1/php.exe
console
$ valet php:proxy -v
Proxying the command to PHP 8.2.9 at C:/php/8.2/php.exe
PHP 8.2.9 (cli) (built: Aug 1 2023 12:41:16) (NTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.2.9, Copyright (c) Zend Technologies
$ valet php:proxy -r "echo 'Hello';" --site=site2
Proxying the command to PHP 7.4.9 c:/php/7.4/php.exe
Hello
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.