Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

InvalidArgumentException composer install symfony

I am trying to install symfony 2.4.1 from a composer.json file using the following command:

php composer.phar install

I run this command from the root directory which contains the composer.json file (var/www/projectname/)

A few packages are installed correctly. When installing the Doctrine package, I get the following error:

InvalidArgumentException $from (/var/www/projectname/bin/doctrine) and $to () must be absolute paths.

This is what i already tried:

  • running php composer.phar selfupdate (now newest version)
  • running php composer.phar update
  • running php composer.phar install

Removed whole project (including composer.json) and ran a new install using composer.phar create-project symfony/framework-standard-edition /var/www/[PROJECTNAME] 2.4.* --prefer-dist

one adition: I use vagrant using virtual box with a windows 7 share. And I'm running the commands through ssh.

Here you'll find the error report http://pastebin.com/rFk4vfnL

This is the output of php --version:

PHP 5.3.10-1ubuntu3.9 with Suhosin-Patch (cli) (built: Dec 12 2013 04:27:25)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
like image 774
Arthur Avatar asked Jan 10 '14 11:01

Arthur


1 Answers

Please delete composer's cache (~/.composer/cache/) and try again.

Also:

  • Are you using the latest version? (composer.phar selfupdate)
  • Are you running composer as a user that has write privileges on everything inside /var/www/projectname/?

update

Composer wants to symlink the doctrine script into your bin directory, and it seems findShortestPath() doesn't receive the correct paths when called. I've never seen this happen before :(

If I understand correctly, you're running composer inside a "synced folder" in a Vagrant guest:

  1. Why are you running composer on the guest, and not on the host?
  2. Can you try running composer (installing your project) somewhere else on the guest? (not in a synced folder) That way you can rule out if it has something to do with that Windows 7 share.

update

So the problem is running composer in a synced folder on a Windows 7 host. The next step is to get composer's source and debug the LibraryInstaller::installBinaries() method. Begin by checking if realpath($binPath) here doesn't return false or something like that.

But I have to ask again: why are you doing it this way? Usually one sets up a Vagrant box with synced folders to be able to develop on the host, and run it on the guest (which mimics the production server). So normally one would run composer on the host, not the guest...

like image 127
Jasper N. Brouwer Avatar answered Oct 15 '22 01:10

Jasper N. Brouwer