John the Ripper
John the Ripper

Reputation: 2439

InvalidArgumentException when attempting to install facebook/php-sdk-v4 via composer

I'm attempting to install the latest Facebook SDK via composer however I receive this error:

$ composer require facebook/php-sdk-v4


  [InvalidArgumentException]                                                                                                                           
  Could not find package facebook/php-sdk-v4 at any version for your minimum-stability (stable). Check the package spelling or your minimum-stability  

After reading the upgrade guide I thought that perhaps my php version is not compatible so I checked the version:

$ php -v
PHP 5.5.9-1ubuntu4.14 (cli) (built: Oct 28 2015 01:34:46) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with XCache v3.1.0, Copyright (c) 2005-2013, by mOo
    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
    with XCache Optimizer v3.1.0, Copyright (c) 2005-2013, by mOo
    with XCache Cacher v3.1.0, Copyright (c) 2005-2013, by mOo
    with XCache Coverager v3.1.0, Copyright (c) 2005-2013, by mOo

How can I resolve this and get the Facebook SDK installed? Thanks

Upvotes: 0

Views: 122

Answers (1)

John the Ripper
John the Ripper

Reputation: 2439

It took some more digging but I finally figured out the problem with this installation. I'm using Symfony 2.8 and it seems that the default Symfony projects preconfigure composer with a default php version even though you may have a higher version installed. The version string is in the config section of composer.json

"config":{
  "bin-dir":"bin",
  "platform":{
    "php":"5.3.9"
  }
}

Once I changed the value to 5.4.0 I was able to install the Facebook SDK.

More discussion about these issues are here and here

Upvotes: 1

Related Questions