安装作曲家时遇到问题

Om3*_*3ga 27 php composer-php

我正在使用以下cammand安装composer

curl -s https://getcomposer.org/installer | php
Run Code Online (Sandbox Code Playgroud)

但我一直收到以下错误消息

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.
Run Code Online (Sandbox Code Playgroud)

如何安装composer才能删除上述错误?

编辑

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)
Run Code Online (Sandbox Code Playgroud)

最新编辑

经过一番研究后,我发现php.ini正在使用的文件是/etc/php.ini.但是,当我在/etc文件夹中检查此文件时,它不在那里./etc文件夹包含php.ini.default链接到的文件夹/private/etc/php.ini.default.所以我说detect_unicode = Off/etc/php.ini.default和重命名该文件php.ini.现在我执行下面的命令

curl -s https://getcomposer.org/installer | php
Run Code Online (Sandbox Code Playgroud)

要么

sudo curl -s https://getcomposer.org/installer | php
Run Code Online (Sandbox Code Playgroud)

然后我得到以下错误

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.
Run Code Online (Sandbox Code Playgroud)

如何在我的计算机上安装composer并删除上述问题?请帮忙

Mik*_*raf 107

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

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

    cd~

  2. 得到作曲家:

    curl -sS https://getcomposer.org/installer | PHP

  3. 将composer移动到$ PATH var中的bin目录:

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

  4. 双重检查作曲家的作品

    作曲家

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

    sudo作曲家自我更新

家酿

brew update
brew tap homebrew/homebrew-php
brew tap homebrew/dupes
brew tap homebrew/versions
brew install php55-intl
brew install homebrew/php/composer
Run Code Online (Sandbox Code Playgroud)

  • 在Ubuntu 13.10上为我工作过. (2认同)

And*_*yco 30

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

curl -sS https://getcomposer.org/installer | php -d detect_unicode=Off
Run Code Online (Sandbox Code Playgroud)


小智 5

在Ubuntu Vivid 15.04中.尝试:步骤:

  1. 打开终端并写入: sudo su并按Enter键.
  2. 粘贴这个:curl -sS https://getcomposer.org/installer | php并按Enter键.(这个安装作曲家,等待完成)
  3. 并且Finaly写出口

注意:对不起,我的英文不好:(