在Yosemite上安装composer时出错

时间:2014-12-29 00:15:49

标签: composer-php

正在运行curl -sS https://getcomposer.org/installer | php会出现以下错误:

#!/usr/bin/env php
All settings correct for using Composer
Downloading...
Could not create file /private/etc/apache2/users/composer.phar: fopen(/private/etc/apache2/users/composer.phar): failed to open stream: Permission denied
Download failed: fopen(/private/etc/apache2/users/composer.phar): failed to open stream: Permission denied
fwrite() expects parameter 1 to be resource, boolean given
Downloading...
Could not create file /private/etc/apache2/users/composer.phar: fopen(/private/etc/apache2/users/composer.phar): failed to open stream: Permission denied
Download failed: fopen(/private/etc/apache2/users/composer.phar): failed to open stream: Permission denied
fwrite() expects parameter 1 to be resource, boolean given
Downloading...
Could not create file /private/etc/apache2/users/composer.phar: fopen(/private/etc/apache2/users/composer.phar): failed to open stream: Permission denied
Download failed: fopen(/private/etc/apache2/users/composer.phar): failed to open stream: Permission denied
fwrite() expects parameter 1 to be resource, boolean given
The download failed repeatedly, aborting.

不确定需要更改哪些权限才能使其生效。我是Mac OS的新手。我尝试使用sudo运行相同的命令,但无济于事。有关在apache2目录中需要更改的内容的任何想法,以使其工作?

1 个答案:

答案 0 :(得分:0)

用户文件夹上的一个简单的chmod 777解决了这个问题。该死的我有时候觉得自己像个白痴。