Please refrain from commenting your suggestion unless you've read through my list of troubleshooting steps. I am updating this list as suggestions come in.
On my co-worker's Windows 7 environment, when trying to install one of our apps built on Symfony 2.5.*, we get the following problem with unlink
:
We have tried the following:
composer self-update
composer update
instead of composer install
(which resulted in the same error below)composer install
from an Administrator DOS shell instead of the git bashcomposer create-project symfony/framework-standard-edition test/ "2.5.*"
and composer create-project symfony/framework-standard-edition path/ "2.3.*"
(in case the issue is version-specific)Any ideas on what's going on? Is this a composer bug, or one of the pleasures of working with Windows? Everything above runs fine on my OSX machine.
Another debugging note... when I try to manually unlink with php -r "unlink('...');"
it deletes the file in question no problems
I've found the issue. An office-wide anti-virus program called "Trend Micro" was doing a "live scanning" of any newly created files. Since the anti-virus program was accessing the file at the same time composer was trying to unlink
the files, composer would fail. Adding the repository as to the anti-virus whitelist (as well as the Windows Indexer to be safe) fixed the problem entirely.
I have created an issue in GitHub for the composer team to work on so that this exception could be handled somehow (e.g. a sleep
function upon failure of the unlink
)
Thanks for the troubleshooting help, everyone.
EDIT: As of this edit, a fix has been written, so if you run into this problem, just run composer self-update
to ensure Composer has the latest fix for this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With