1

I cloned a git project, then run composer update command, I got this error message on composer:

  - Installing symfony/symfony (v2.2.4)
    Downloading: 100%



  [UnexpectedValueException]
  'E:\Sites\myapp-api\vendor/symfony/symfony/268ac81f41a8a73a56ef570d9e7980
  27.4' is not a zip archive.



update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock]
 [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [
-o|--optimize-autoloader] [packages1] ... [packagesN]

I tried to delete composer.lock and run composer update command again, still return the same error.

I also try to run composer update symfony/symfony, and with --prefer-dist but still return the same error message 'is not a zip archive'.

How to solve this problem?


I try and try again, and now there are 3 ites of downloading symfony/symfony

  - Installing symfony/symfony (v2.2.4)
    Downloading: 100%
  - Installing symfony/symfony (v2.2.4)
    Downloading: 100%
  - Installing symfony/symfony (v2.2.4)
    Downloading: 100%



  [UnexpectedValueException]
  'E:\Sites\trainme-api\vendor/symfony/symfony/698bb2e6e680e6c886eb5c70f5d93e
  97.4' is not a zip archive.
Permana
  • 1,972
  • 2
  • 33
  • 51

1 Answers1

2

I had silimar issue. Clearing composer cache helped.

Look here: https://github.com/composer/composer/issues/1242

If You are using linux composer cache should be in: ~/.composer/

You can clear it with backup with this command:

 mv ~/.composer/cache ~/.composer/cache.bak

Update

Check cache-dir param in your composer.json

http://getcomposer.org/doc/04-schema.md#config

cache-dir: Defaults to $home/cache on unix systems and C:\Users\\AppData\Local\Composer on Windows. Stores all the caches used by composer. See also COMPOSER_HOME.

UPDATE:

You can find cache dir with command (thanks to @Permana):

 php composer.phar  config cache-dir 
tiriana
  • 668
  • 1
  • 7
  • 24
  • I try to search for the composer home directory in Windows (`C:\Users\{USER}\AppData\Roaming\Composer`) and found nothing, only .`htaccess` file. – Permana Aug 02 '13 at 14:04
  • Check cache-dir param in your composer.json http://getcomposer.org/doc/04-schema.md#config cache-dir: Defaults to $home/cache on unix systems and C:\Users\\AppData\Local\Composer on Windows. Stores all the caches used by composer. See also COMPOSER_HOME. – tiriana Aug 02 '13 at 15:13
  • 2
    Aha, I'm looking in wrong cache folder. I check the cache folder by running `composer config cache-dir`, and delete everything in that folder. Run `composer update` again and everything works fine again. THanks. – Permana Aug 02 '13 at 23:55