解决 valet install Unable to determine linked PHP

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!
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值