Question: I am trying to run the `php composer.phar self-update` command for my composer.phar file for my laravel project. 

When I run this I get the following error:

```
Composer update failed: the "/Applications/MAMP/htdocs/*******/**********/composer.phar" file could not be written

```

I have looked at the permissions, and I do have read and write access for composer.phar on this machine.

Any ideas what could be going on?

Answer: 
I had to run as sudo:

```
sudo /usr/bin/composer.phar self-update

```
Try this instead by using "super user do", then composer upgrade command.
This worked for me:

`sudo composer self-update`

enoy!!