I created a package and have put it on a private Packagist which fetches from private Bitbucket repo. This all works fine until I try install the package. My composer.json looks like this:
{
"name": "XXXX/fields",
"description": "Field processor for easy saving and updating",
"type": "library",
"autoload": {
"psr-4": {
"XXXX\\Fields\\": "src/"
}
},
"authors": [
{
"name": "This Nerd",
"email": "This.Nerd#XXXX.nl"
}
],
"require": {},
"extra": {
"laravel": {
"providers": [
"XXXX\\Field\\FieldServiceProvider"
],
"aliases": {
"Field": "XXXX\\Field\\Facades\\Initiators\\Field"
}
}
}
}
When installing composer finds conflict with other packages:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- psr/cache 3.0.0 requires php >=8.0.0 -> your php version (7.4.19) does not satisfy that requirement.
- zircote/swagger-php 3.2.3 requires doctrine/annotations ^1.7 -> satisfiable by doctrine/annotations[1.13.1].
- darkaonline/l5-swagger 8.0.7 requires zircote/swagger-php 3.* -> satisfiable by zircote/swagger-php[3.2.3].
- doctrine/annotations 1.13.1 requires psr/cache ^1 || ^2 || ^3 -> satisfiable by psr/cache[3.0.0].
- darkaonline/l5-swagger is locked to version 8.0.7 and an update of this package was not requested.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
As you can see I'm not requiring any packages yet and have no requirements defined in my composer.json. The current version tag in the packagist is 1.0.1. When fetching composer tries "Using version ^1.0". So this all seems fine, but it isn't.
Any suggestions are welcome.
As nice_dev stated, the composer error was exclusively a php version error. This was due to me running it on the command line, where i run 7.4. However, I'm running sail and sail runs 8.0. So I needed to run it in sail. The reason I ran it local was because I had no ssh key on the sail server. In the end I solved this by adding a oauth key to the composer config
Related
I have two Symfony projects: project-a (root project) and project-b.
My composer.json file from project-a contains:
{
"name": "myprojects/project-a",
"require": {
"myprojects/project-b": "dev-master",
},
"repositories": [
{
"type": "vcs",
"url": "git#bitbucket.org:MYPROJECTS/project-b.git"
}
]
}
And my composer.json from project-b:
{
"name": "myprojects/project-b",
"require": {
"guzzlehttp/guzzle": "^6.3"
}
}
I need to update project-b but when I execute the command composer update myprojects/project-b from project-a, I get this composer error:
[Composer\DependencyResolver\SolverProblemsException]
Problem 1
Installation request for myprojects/project-b dev-master -> satisfiable by
myprojects/project-b[dev-master].
myprojects/project-b dev-master requires guzzlehttp/guzzle ^6.3 -> no matching package found.
Potential causes:
A typo in the package name
The package is not available in a stable-enough version according to your minimum-stability setting
I have tried solve this adding "minimum-stability": "dev" property to both composer.json files, but it doesn't works.. How can I solve this?
Thanks.
As commented in guzzle/guzzle issue 861:
Looks like an issue with your caching.
Try clearing your composer cache, and self-update composer, then try again.
The OP Wildchild confirms in the comments:
composer clear cache and self-update solves my problem
"minimum-stability": "dev" is not needed.
I want to integrate a method from which a guest also can do payments on my site. So, i am implementing this SDK of paypal. It is required to install the compser and run it for dependencies. So, i ran this command to install composer.phar file inside samples folder
curl -sS https://getcomposer.org/installer | php -- --install-dir=/var/www/html/app/paypaltest/samples
then to install composer i ran this command:
php composer.phar install
But it is showing error as
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package paypal/merchant-sdk-php 1.0.0 could not be found.
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.
Not sure why i am getting error of version 1.0.0 when i explicitly defining the version number i.e v3.8.107
This is the composer.json file which i am using. Can anyone help me know what is the issue and why can't i install the composer correctly. Am i missing any thing?
{
"name": "paypal/merchant-sdk-php",
"description": "PayPal Merchant SDK for PHP",
"keywords": ["paypal", "php", "sdk"],
"homepage": "https://developer.paypal.com",
"license": "Apache2",
"authors": [
{
"name": "PayPal",
"homepage": "https://github.com/paypal/merchant-sdk-php/contributors"
}
],
"require": {
"paypal/merchant-sdk-php":"v3.8.107"
},
"autoload": {
"psr-0": {
"PayPal\\Service": "lib/",
"PayPal\\CoreComponentTypes": "lib/",
"PayPal\\EBLBaseComponents": "lib/",
"PayPal\\EnhancedDataTypes": "lib/",
"PayPal\\PayPalAPI": "lib/"
}
}
}
Try just the following in your composer.json:
{
"require": {
"paypal/merchant-sdk-php": "v3.8.107"
}
}
I've got the old PHP azure SDK working on a Azure website, but I would like to migrate to the new one. Unfortunately, I'm unable to get the new one to work.
I've installed the SDK manually and followed the "Usage" steps on this page: https://github.com/Azure/azure-sdk-for-php. Instead of 'use' I use 'require', maybe that's where it goes wrong but I don't know how to use namespaces.
The environment I use to edit my code is dreamweaver.
The following code goes wrong at the line starting with $tableRestProxy
<?php
require("WindowsAzure/WindowsAzure.php");
require("WindowsAzure/Common/ServicesBuilder.php");
require("WindowsAzure/Common/ServiceException.php");
require("WindowsAzure/Table/TableRestProxy.php");
$connectionString = 'DefaultEndpointsProtocol=https;AccountName=[AccountName];AccountKey=[AccountKey]';
// I do know that I have to declare the AccountName and AccountKey here. Left it out for privacy reasons.
$tableRestProxy = ServicesBuilder::getInstance()->createTableService($connectionString);
?>
update
Now I'm trying to use Composer to install the SDK. My composer.json file looks like this:
{
"require": {
"microsoft/windowsazure": "*"
},
"repositories": [
{
"type": "pear",
"url": "http://pear.php.net"
}
],
"minimum-stability": "dev"
}
When I run the composer.phar I get the following result:
Onwijs#JEROENVINK /e/Users/Public/Documents/00_speeltuin_azure/newsdk
$ php composer.phar diagnose
Checking composer.json: OK
Checking platform settings: FAIL
The xdebug extension is loaded, this can slow down Composer a little.
Disabling it when using Composer is recommended, but should not cause issues bey
ond slowness.
Checking git settings: OK
Checking http connectivity: OK
Checking disk free space: OK
Checking composer version: OK
Onwijs#JEROENVINK /e/Users/Public/Documents/00_speeltuin_azure/newsdk
$ php composer.phar install
Loading composer repositories with package information
Initializing PEAR repository http://pear.php.net
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for microsoft/windowsazure 0.4.0 -> satisfiable by mi
crosoft/windowsazure[v0.4.0].
- microsoft/windowsazure v0.4.0 requires pear-pear/http_request2 * -> no mat
ching package found.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your min
imum-stability setting
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> f
or more details.
Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common
problems.
I don't see what I'm doing wrong.
There seems to be a problem with pear and the Azure SDK via composer.
I found a way around it by modifying my composer.json file to look something like this:
{
"require": {
"microsoft/windowsazure": "*",
"pear-pear.php.net/http_request2": "*",
"pear-pear.php.net/mail_mime": "*",
"pear-pear.php.net/mail_mimedecode": "*"
},
"repositories": [
{
"type": "pear",
"url": "http://pear.php.net"
}
],
"minimum-stability": "dev"
}
Notice the three lines:
"pear-pear.php.net/http_request2": "*",
"pear-pear.php.net/mail_mime": "*",
"pear-pear.php.net/mail_mimedecode": "*"
these provide more explicit information to composer and using this approach things seem to compose just fine.
Hope that helps.
I have written a library that I want to use in another project. However, when I add the library dependency to my project I get the following error after running composer update -vvv:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for my/library dev-master -> satisfiable by my/library[dev-master].
- my/library dev-master requires doctrine/migrations dev-master -> no matching package found.
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.
This error is very confusing to me since my project has my library as it's only dependency, i.e. my project composer.json looks like this:
{
"name": "my/project",
"type": "project",
"description": "My project",
"autoload": {
"psr-0": { "MyNamespace\\": ["src/", "tests/src/"] }
},
"repositories": [ {
"type": "vcs",
"url": "git#bitbucket.org:my/library"
} ],
"require": {
"php": ">=5.5",
"my/library": "dev-master"
},
"require-dev": {
"phpunit/phpunit": "3.*"
}
}
As you can see, pretty straight forward. The reason the version of my library is requiring dev-master is because master is currently the only branch I work on (I work alone, no need for other branches at the moment).
So far the only way for the resolve this problem is by adding the dependencies of my library composer.json to my project's composer.json which seems like an unnecessary step.
How can I resolve this dependency issue?
It looks to me as if it is a stability issue. Add the following two lines to your composer.json:-
"minimum-stability": "dev",
"prefer-stable": true,
ref:- minimum-stability & prefer-stable
Hopefully that will sort out your problem.
I'm having difficulty getting the PHP client libraries package for Windows Azure via Composer. The problem would appear to be around Pear dependencies the package has.
The contents of the composer.json file:
{
"require": {
"microsoft/windowsazure": "dev-dev"
},
"repositories": [
{
"type": "pear",
"url": "http://pear.php.net"
}
]
}
The output following running "composer update" reads:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for microsoft/windowsazure dev-dev -> satisfiable by microsoft/windowsazure[dev-dev].
- microsoft/windowsazure dev-dev requires pear-pear/http_request2 * -> no matching package found.
I've never experienced any difficulty getting this package in the past. I can provide more verbose logs on request.
I recall seeing a few issues raised due to changes in how replaces works in regards to pear bridging.
This issue needs to be fixed upstream to have pear-pear/* replaced with pear-pear.php.net/*, but as a workaround in your root composer.json you can explicitly require the dependencies in order to have them discovered by the solver.
{
"require": {
"microsoft/windowsazure": "dev-dev",
"pear-pear.php.net/http_request2": "*",
"pear-pear.php.net/mail_mime": "*",
"pear-pear.php.net/mail_mimedecode": "*"
},
"repositories": [
{
"type": "pear",
"url": "http://pear.php.net"
}
]
}
The above composer.json should work in the latest and future versions of composer. Tested with Composer version aa9c257f0efd1a54c93ba95282821a497bc15d75 2014-03-09 15:09:15
This is a composer bug, I fixed it by using an older version of composer. Your composer.json is fine. The version I used was:
Composer version 42c496752ab6ec6c45b185b70c8c39220da01b1c
https://github.com/composer/composer/archive/42c496752ab6ec6c45b185b70c8c39220da01b1c.zip