I have a Vagrant running Linux and I\'m trying to install Symfony.
After the command composer create-project symfony/framework-standard-edition ./ \"2.5.*\"
Another thing to check for, Composer needs to run in the context of a directory it has permissions to.
In my case I was trying to issue a create-project command from /var/www, aimed against /var/www/html. /var/www is owned by root, /var/www/html is owned by the same user I executed Composer as (www-data). I got the following error; Could not delete /var/www/html/:
Issued the same Composer command from within /var/www/html itself and it worked perfectly.
It happened once to me and it turns out that I was hitting composer's timeout.
You could take the following measures to gain some speed:
dist
as preferred install type.https
protocol for github, which is faster.~/.composer/config.json
{
"config": {
"process-timeout": 600,
"preferred-install": "dist",
"github-protocols": ["https"]
}
}
If you still have problems after that, you can also clear composer's cache:
rm -rf ~/.composer/cache
On AWS I got this error while deploying Yii framework project there was this
/var/app/current/vendor/
folder i deleted everything inside it came back to my document root and ran composer update it fetched all the repos again.
In my case , by removing the plugin and re-create the box solve the issue.
I have solved the problem by creating a mount :
In /home/vagrant create a folder named vendor
then apply command : mount --bind /home/vagrant/vendor /path/to/source
/vendor
I've came across this issue and spent quite some time making a research. I've tried every single possible option to fix it but none of them worked for me. For me the bug occured on GNU/Linux host with Vagrant and VirtualBox provider.
It turns out it's a VirtualBox bug related to the file system layer and race conditions when creating/deleting files. It occurs only for VirtualBox shared folders, not for regular ones. The sad part is that it seems like it's not going to be fixed any time soon.
Some guys reported that they were able to solve the problem using the following tricks:
6.0.4
.nfs
or rsync
instead of shared folders.--no-plugins
option.But all of this seemed dirty to me. I personally was able to use a workaround suggested on GitHub which is to configure composer to install packages from sources. That's a simple and kind of clean trick which should not have significant negative side effects on your workflow. Try putting the following config into your ~/.config/composer/config.json
. Or instead you can edit your composer.json
accordingly depending on your needs. Keep in mind that composer.json
will override your global config.
{
"config": {
"preferred-install": "source"
}
}