安装作曲家时遇到问题

2022-08-30 14:40:36

我正在安装具有以下凸轮的作曲家

curl -s https://getcomposer.org/installer | php

但我一直得到下面的错误消息

Zafars-MacBook-Pro:etc zafarsaleem$ curl -s https://getcomposer.org/installer | php
#!/usr/bin/env php
Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:

The detect_unicode setting must be disabled.
Add the following to the end of your `php.ini`:
detect_unicode = Off

A php.ini file does not exist. You will have to create one.

如何安装作曲家删除上述错误?

编辑

Zafars-MacBook-Pro:etc zafarsaleem$ php --ini
Configuration File (php.ini) Path: /etc
Loaded Configuration File:         (none)
Scan for additional .ini files in: (none)
Additional .ini files parsed:      (none)

最新编辑

经过一些研究,我发现正在使用的文件位于.但是,当我在文件夹中检查此文件时,它不存在。 文件夹包含链接到 的文件夹。所以我添加了并将此文件重命名为.现在当我执行以下命令时php.ini/etc/php.ini/etc/etcphp.ini.default/private/etc/php.ini.defaultdetect_unicode = Off/etc/php.ini.defaultphp.ini

curl -s https://getcomposer.org/installer | php

sudo curl -s https://getcomposer.org/installer | php

然后我得到以下错误

Zafars-MacBook-Pro:/ zafarsaleem$ sudo curl -s https://getcomposer.org/installer | php
#!/usr/bin/env php
All settings correct for using Composer
Downloading...
Download failed: failed to open stream: Permission denied
Downloading...
Download failed: failed to open stream: Permission denied
Downloading...
Download failed: failed to open stream: Permission denied
The download failed repeatedly, aborting.

如何在计算机上安装作曲家并消除上述问题?请帮忙


答案 1

要在MacOSX上下载/安装,您可以执行以下步骤尝试以下自制步骤:

  1. 转到您可以写入的目录:

    光盘 ~

  2. 获取作曲家:

    卷曲-sS https://getcomposer.org/installer|菲律宾比索

  3. 将作曲家移动到$PATH var 中的 bin 目录中:

    sudo mv composer.phar /usr/local/bin/composer

  4. 双重检查作曲家作品

    作曲家关于

  5. (可选)更新作曲家:

    sudo composer 自我更新

自制

brew update
brew tap homebrew/homebrew-php
brew tap homebrew/dupes
brew tap homebrew/versions
brew install php55-intl
brew install homebrew/php/composer

答案 2

请尝试此操作,并动态更改设置,仅用于此命令

curl -sS https://getcomposer.org/installer | php -d detect_unicode=Off

推荐