Jump to content
Larry Ullman's Book Forums

Installing Composer In Ubuntu Webserver

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:

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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...