PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, January 24, 2022

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

 January 24, 2022     composer-php, facebook-sdk-4.x, symfony     No comments   

Issue

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


Solution

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



Answered By - John the Ripper
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing