Laravel valet linked php error

后端 未结 6 570
温柔的废话
温柔的废话 2021-01-17 19:07

I got an error.

$ valet install

[DomainException]                
Unable to determine linked PHP.  

install

\'which\' command returns:

6条回答
  •  野的像风
    2021-01-17 19:38

    I tried all of the suggestions here—and several from elsewhere—before I hit on the solution. This applies to PHP 7.2 (no guarantee for other versions). If you are using the original Larvel Valet, open the file:

    ~/.composer/vendor/laravel/valet/cli/Valet/Brew.php

    ...or, if you're using Valet+

    ~/.composer/vendor/weprovide/valet-plus/cli/Valet/Brew.php

    Locate the supportedPhpVersions method. In some versions, it will return an array right in the method:

    return ['php72', 'php71', 'php70', 'php56'];

    Change this to:

    return ['7.2', 'php72', 'php71', 'php70', 'php56'];

    In other cases, it'll reference const SUPPORTED_PHP_VERSIONS, and the change will be similar.

    Save the file, restart valet, and Bob's your uncle!

提交回复
热议问题