PHP
Versions
PHP is optional and not installed by default - install the version(s) you need via install,
e.g. valet.sh install php81. Versions 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4 and 8.5 are supported and
can be installed/run at the same time.
| Version | Linux socket | MacOS socket | Servicename | xdebug 2.* | xdebug 3.* |
|---|---|---|---|---|---|
| php-5.6 | /var/run/php/php5.6-fpm.sock | /tmp/vsh-php56.sock | php56 | ||
| php-7.0 | /var/run/php/php7.0-fpm.sock | /tmp/vsh-php70.sock | php70 | ||
| php-7.1 | /var/run/php/php7.1-fpm.sock | /tmp/vsh-php71.sock | php71 | ||
| php-7.2 | /var/run/php/php7.2-fpm.sock | /tmp/vsh-php72.sock | php72 | ||
| php-7.3 | /var/run/php/php7.3-fpm.sock | /tmp/vsh-php73.sock | php73 | ||
| php-7.4 | /var/run/php/php7.4-fpm.sock | /tmp/vsh-php74.sock | php74 | ||
| php-8.0 | /var/run/php/php8.0-fpm.sock | /tmp/vsh-php80.sock | php80 | ||
| php-8.1 | /var/run/php/php8.1-fpm.sock | /tmp/vsh-php81.sock | php81 | ||
| php-8.2 | /var/run/php/php8.2-fpm.sock | /tmp/vsh-php82.sock | php82 | ||
| php-8.3 | /var/run/php/php8.3-fpm.sock | /tmp/vsh-php83.sock | php83 | ||
| php-8.4 | /var/run/php/php8.4-fpm.sock | /tmp/vsh-php84.sock | php84 | ||
| php-8.5 | /var/run/php/php8.5-fpm.sock | /tmp/vsh-php85.sock | php85 |
manage services
to manage the state (enable/disable/start/stop) of each installed php version, use the service command (Read more about the service command here).
# stop and disable php7.2
valet.sh service disable php72
# start and enable php5.6
valet.sh service enable php56
Info
disabling a php service stops only the FPM service for the selected version! You can still use all installed php versions on cli. (e.g "php5.6")
Manage xdebug
Versions
xdebug2 and xdebug3 are provided by valet.sh, but only php7.3 and php7.4 supports both xdebug major versions
change the default xdebug version
valet.sh service default xdebug3
Example: change xdebug version from 3 to 2
Let's assume you are running xdebug3 on php7.4 and want to switch to xdebug2
- ensure xdebug is disabled for your desired php version
valet.sh xdebug off 7.4 - switch xdebug version
valet.sh service default xdebug2 - enable xdebug for php7.4
valet.sh xdebug on 7.4 - xdebug2 is now enabled for php7.4!

Info
Setting a "default" xdebug version has no effect on php versions that supports only one xdebug version. For example php8.0 will always load xdebug3 even when the default version is set to xdebug2!