首页 > 解决方案 > 在我的 Mac 上使用自制软件安装 php 71 时出错

问题描述

我已经和 Vallet 一起开发了一段时间。今天我想将 laravel 5.4 更新到 5.5。在这样做之前,我运行composer global update。导致 Vallet 停止工作。

拳头我试图做以下事情:

cd ~/.composer/

sudo chown -R $(whoami) vendor

来源:https ://laracasts.com/discuss/channels/general-discussion/getting-valet-not-found-error

我没有解决问题。然后我决定重新安装 Vallet。特此我做了以下事情:

我跟着这个:https ://github.com/laravel/valet/issues/321

停止和卸载服务

sudo brew services stop php71 dnsmasq nginx
brew uninstall php71 dnsmasq nginx

删除相关配置文件和代客主文件夹

sudo rm -r /usr/local/etc/php /usr/local/etc/nginx /usr/local/etc/dnsmasq.conf
sudo rm -r ~/.valet /var/root/.valet

安装服务我试过这个:

brew install php71
$ brew tap homebrew/php
$ brew install php71
brew install homebrew/php/php71 

都给出了以下错误:

MacBook-Pro:~ mblivier$ brew install homebrew/php/php71 
==> Installing php71 from homebrew/php Error: The following formula: php71 
cannot be installed as a binary package and must be built from source.

Install the Command Line Tools:xcode-select --install

我是新手,不知道如何解决这个问题。有什么建议如何安装 php 并进一步重新安装 Vallet?

标签: phplaravel-5homebrewlaravel-valet

解决方案


你需要 xcode 来构建 php,所以首先运行:

xcode-select --install

安装xcode,以后你可以brew install php71


推荐阅读