mac安装valet虚拟环境后提示Unable to determine linked
$ valet install
Stopping nginx...
Installing nginx configuration...
Installing nginx directory...
Updating PHP configuration...
In Brew.php line 182:
Unable to determine linked PHP.
找了些资料,用以下命令:
$ brew link php
Linking /usr/local/Cellar/php/7.2.11...
Error: Could not symlink sbin/php-fpm
/usr/local/sbin is not writable.
结果还是报错,最后找到解决方案:
$ brew doctor
...
Warning: The following directories do not exist:
/usr/local/sbin
You should create these directories and change their ownership to your account.
sudo mkdir -p /usr/local/sbin
sudo chown -R $(whoami) /usr/local/sbin
...
注意以上代码明确告知目录 /usr/local/sbin 不存在,后面已经给出解决方法:
$ sudo mkdir -p /usr/local/sbin
$ sudo chown -R $(whoami) /usr/local/sbin
然后再次运行:
$ brew link php
Linking /usr/local/Cellar/php/7.2.11... 24 symlinks created
再次运行 valet install
$ valet install
Stopping nginx...
Installing nginx configuration...
Installing nginx directory...
Updating PHP configuration...
Restarting php...
Installing dnsmasq...
[dnsmasq] is not installed, installing it now via Brew... ?
Restarting dnsmasq...
Valet is configured to serve for TLD [.test]
Restarting nginx...
Valet installed successfully!