6

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
3
  • It's a unix/linux guest on a Windows 7 host? Commented Jan 15, 2014 at 22:12
  • Could you show us the output of php --version and php --re. Thanks! Commented Jan 15, 2014 at 22:35
  • @JasperN.Brouwer Vagrant / Virtualbox is running on a Windows 7 machine. see original post for more info about php Commented Jan 15, 2014 at 22:40

3 Answers 3

7
+50

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...

Sign up to request clarification or add additional context in comments.

6 Comments

I removed the cache files and did a new install from within the project. The same errors occurs. Is there some environment variable in Vagrant which is missing?
running composer in a non synced directory works. I'm running composer through a ssh session from my Windows machine to my Virtualbox (Debian) machine.
I can't really help with the debugging, because I don't have a Windows machine. But it shouldn't be hard to do yourself :)
Hi Jasper, now the monkey comes out of the sleeve ;-) I am not realy sure which is the host and which is the guest. But I am running the install script within the Debian distro of my virtualbox
The host is the "real" machine, the one you installed Virtualbox on. The guest is the virtual machine running inside Virtualbox ;)
|
0

Try to use this install instruction with more parameters:

$ php composer.phar create-project symfony/framework-standard-edition /path/to/webroot/Symfony 2.4.1

Comments

0

From what I can tell (based on the answer from @jasper) there is an issue with composer creating the symlink to your bin folder... This is probably due to the filesystem not supporting symlinks (the host's filesystem, which is then shared with the guest), a good test would be to try and run vagrant on a Linux box and see if the problem persists.

The only way I can think to solve this would be to install the dependencies globally inside the guest (which kinda defeats the point of using Vagrant).

Please note I do not have a windows machine to test on, but the symlink issue has caught me out before when using a samba share and NTFS/FAT32 file system.

3 Comments

Composer has some code to deal with symlinks on things like smb-mounts. The issue is not in creating the symlink, but determining the paths to use for creating the symlink. PS: running composer on a *nix guest on a *nix host using synced folders works perfectly :)
kewl @ composer working around symlinks, havn't used windows in a long while... @arthur can you post the Vagrant and composer configs? might be something there.
I have had the issue on Debian (host) and Ubuntu (guest).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.