gpt4 book ai didi

php - 如何在 macOS 上安装 Composer?

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:56:26 25 4
gpt4 key购买 nike

我试图在我的 macOS 版本上安装 Composer:high sierra--> 10.13.4

但是在使用命令之后:

sudo php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" 

它创建了一些文件和目录,但没有下载 Composer 。我的终端显示以下错误:

No log handling enabled - using stderr logging

Created directory: /var/db/net-snmp

Created directory: /var/db/net-snmp/mib_indexes`

我该如何解决这个问题?

最佳答案

旧答案(Ruby Homebrew 安装程序现已弃用,已在狂欢。):

首先在您的 MAC 上安装 Brew:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

新答案:

首先在您的 MAC 上安装 Brew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

然后安装PHP:

brew update
brew install php
brew install composer

要测试安装,请运行:

 $ composer -V

关于php - 如何在 macOS 上安装 Composer?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51656914/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com