Jump to content
Larry Ullman's Book Forums

Installing Composer In Ubuntu Webserver


another_noob
 Share

Recommended Posts

I decided to install Yii2 on my Ubuntu server I use for live demo's for clients. While trying to install Composer I ran into permissions problems with this line of code:

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

  I would get these errors:

Downloading...
Could not create file //composer.phar: fopen(//composer.phar): failed to open stream: Permission denied
Download failed: fopen(//composer.phar): failed to open stream: Permission denied
fwrite() expects parameter 1 to be resource, boolean given

I prefaced the command with "sudo" and received the same permissions output. After some poking around I found the problem to be I needed to add a "sudo" after the pipe also. Like this:

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

After that, Things worked as expected. Hopefully this will save someone some agony someday.

Link to comment
Share on other sites

 Share

×
×
  • Create New...