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

Monday, January 31, 2022

[FIXED] composer not installing latest facebook php sdk due to multiple php versions

 January 31, 2022     composer-php, facebook, facebook-php-sdk, php     No comments   

Issue

I'm trying to load the latest php sdk for facebook but I am getting errors with composer. Any idea on what I may be doing wrong?

{
  "minimum-stability": "dev",
  "require" : {
    "facebook/php-sdk-v4" : "4.0.*"
  }
}
[root@gridjungle gridjungle]# composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - facebook/php-sdk-v4 4.0.8 requires php >=5.4.0 -> no matching package found.
    - facebook/php-sdk-v4 4.0.7 requires php >=5.4.0 -> no matching package found.
    - facebook/php-sdk-v4 4.0.6 requires php >=5.4.0 -> no matching package found.
    - facebook/php-sdk-v4 4.0.5 requires php >=5.4.0 -> no matching package found.
    - facebook/php-sdk-v4 4.0.4 requires php >=5.4.0 -> no matching package found.
    - facebook/php-sdk-v4 4.0.3 requires php >=5.4.0 -> no matching package found.
    - facebook/php-sdk-v4 4.0.2 requires php >=5.4.0 -> no matching package found.
    - facebook/php-sdk-v4 4.0.1 requires php >=5.4.0 -> no matching package found.
    - facebook/php-sdk-v4 4.0.0 requires php >=5.4.0 -> no matching package found.
    - Installation request for facebook/php-sdk-v4 4.0.* -> satisfiable by facebook/php-sdk-v4[4.0.0, 4.0.1, 4.0.2, 4.0.3, 4.0.4,

4.0.5, 4.0.6, 4.0.7, 4.0.8].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion>

for more details.

Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
[root@gridjungle gridjungle]# composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update

to update them. Nothing to install or update Generating autoload files


Solution

Version 4+ of the PHP SDK requires PHP 5.4+.

If you cannot upgrade your PHP version, you'll have to use the older SDK, "facebook/php-sdk"

edit by Clint C.: Fosco was right. Due to having multiple versions of PHP installed I had to specify which version for composer to use. To do this though I had to install composer locally in my project location and not use the globally installed version.

/usr/local/php-5.5.13-cgi/bin/php composer.phar update


Answered By - Fosco
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

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