我正在使用以下 cammand 安装作曲家
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
文件夹中检查此文件时,它不存在。/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
或者
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.
如何在我的计算机上安装 composer 并消除上述问题?请帮忙