Composer: requested php package not found

Every time I try to run composer install , the hangs fail due to the following error:

 The requested package php could not be found 

This works for me on the LAMP stack, but I'm trying to get it to work on the LEMP stack now, with php5-fpm and its not very good.

 $ php -v PHP 5.5.8-3+sury.org~precise+2 (cli) (built: Jan 29 2014 13:23:55) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies 

EDIT

I have other things, but I tested the following composer.json on the same server and still did it.

composer.json

 { "require": { "php": "5.4.*" } } 

my composer version

 Composer version b7a9ea4187bce63f418bf7ba035b63dcb1e23ef6 2014-02-06 22:07:47 

Did I miss something?

+6
source share
1 answer

Well, it's simple: Composer is exactly what you tell him to do.

You request any version of PHP 5.4. You obviously do not allow versions 5.5. Therefore, Composer correctly complains that you have the wrong version of PHP (your PHP 5.5, you request 5.4. *).

It is very unlikely that your code will not work with a newer version, so it is best to use this composer.json content:

 { "require": { "php": ">=5.4" } } 

A request for a version greater than or equal to 5.4 will also contain 5.5 and higher.

+13
source

All Articles