JavierIEH
JavierIEH

Reputation: 741

Composer not working on AWS Ubuntu server, locally works fine

Composer install command works fine locally on my computer:

When I connect via ssh to the ubuntu server, and run the same command I get this.

PHP Fatal error:  Class 'Composer\Installers\Installer' not found in phar:///usr/local/bin/composer/src/Composer/Installer/InstallerInstaller.php on line 102

Fatal error: Class 'Composer\Installers\Installer' not found in phar:///usr/local/bin/composer/src/Composer/Installer/InstallerInstaller.php on line 102

I followed the instructions here for both machines: https://github.com/composer/composer/blob/master/README.md

I am missing some dependencies here? I can't figure out why that error.

Edit: Here is the .json (project is symfony 1.4, adding tags as well)

{
  "minimum-stability": "dev",
  "require"     : {
    "snappy/sfSnappyPlugin": "*"
  },
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/FloranBrutel/sfSnappyPlugin.git"
    }
  ]
}

Edit2: The output of the php -v on the AWS server

PHP 5.3.10-1ubuntu3.4 with Suhosin-Patch (cli) (built: Sep 12 2012 18:59:41) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies

On my machine I have:

PHP 5.3.6-13ubuntu3.9 with Suhosin-Patch (cli) (built: Sep 12 2012 19:00:27) 
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans

Upvotes: 2

Views: 2252

Answers (2)

Carl Owens
Carl Owens

Reputation: 1292

I have managed to replicate your problem. Within the directory you are running composer, you should have a path like so:

vendor/composer/installers/src/Composer/Installers

and within this directory there should exist an Installer.php file. I managed to get the same error you are getting by deleting that one file.

So I believe a solution would be to simply completely remove your vendor and plugins directories and try running composer install again, forcing the complete re-download of all the vendors in your composer.json. Hope this helps.

Upvotes: 7

Damien
Damien

Reputation: 5882

What are the exact commands you run?

What you should do:

  • run rm -rf vendor/* to erase all possible composer data (it use vendor/.composer as a cache)
  • run composer self-update to update Composer to it latest. Does this works?
  • try composer -V
  • make sure you have openSsl on the server (as you are requiring over https)
  • switch APC to false on the cli apc.enable_cli=0

Upvotes: 1

Related Questions