Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to install composer with the command:

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

And I am getting this error:

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.

I don't know why? Do you have an idea? I tryed to google it but nothing.

share|improve this question
up vote 11 down vote accepted

Your curl command is running as root (via sudo) but your php command is not. Try moving your sudo between the pipe ("|") and 'php' (assuming you want your installer to run as root in the first place...).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.