API Platform v1.1.1 & Symfony 3.2.8 composer conflict - php

I have Symfony Demo Application up and running and now I'm trying to install API Platform as a standalone bundle.
I'm using PHP 7.0.10 with latest composer, but my previous test was using PHP 5.6.20.
When I try to add API Platform Core as a dependency, I get the following error message:
$ composer require api-platform/core
Using version ^1.1 for api-platform/core
./composer.json has been updated
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
- Installation request for symfony/symfony (locked at v3.2.8, required as ^3
.2) -> satisfiable by symfony/symfony[v3.2.8].
- api-platform/core v1.1.0 requires phpdocumentor/reflection ^1.0.7 -> satis
fiable by phpdocumentor/reflection[1.0.7].
- api-platform/core v1.1.1 requires phpdocumentor/reflection ^1.0.7 -> satis
fiable by phpdocumentor/reflection[1.0.7].
- Conclusion: don't install phpdocumentor/reflection 1.0.7
- Installation request for api-platform/core ^1.1 -> satisfiable by api-plat
form/core[v1.1.0, v1.1.1].
Installation failed, reverting ./composer.json to its original content.

In your composer.json file:
Find:
"symfony/symfony": "3.2.*",
Replace with:
"symfony/symfony": "3.3.*",
...or:
"symfony/symfony": "^3.2.*",
You'll probably need (want) to run composer update first, THEN add your api-platform package with composer require api-platform/core so you have all the dependencies properly loaded, but it's not essential.

With PHP 7.x, you should be using ^2.0, e.g.
composer require api-platform/core ^2.0
Note: To workaround PHP 7.x requirements, you can try to add --ignore-platform-reqs.
If you get the error about minimum-stability, change it to beta in your composer.json file.
Source: Compatibility issue when using composer require with symfony 3.1.4 at GitHub.
See: Installing API Platform Core.

Related

laravel/ui[v3.0.0, ..., v3.2.0] require illuminate/console ^8.0 -> found illuminate/console[v8.0.0, ..., v8.36.2]

I am trying to make pdf using baaryvdh/dompdf in laravel but while installing the package using the command:
`composer require barryvdh/laravel-dompdf`
getting the error:
Using version ^0.9.0 for barryvdh/laravel-dompdf
./composer.json has been updated
Running composer update barryvdh/laravel-dompdf
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/ui[v3.0.0, ..., v3.2.0] require illuminate/console ^8.0 -> found illuminate/console[v8.0.0, ..., v8.36.2] but these were not loaded, likely because it conflicts with another require.
- Root composer.json requires laravel/ui ^3.0 -> satisfiable by laravel/ui[v3.0.0, v3.1.0, v3.2.0].
Run below command
composer require barryvdh/laravel-dompdf:0.8.5
But Remember above version needs,
This package requires php ^7.1.3.
Because if will not pass version bydefault it will take latest version and the latest version of dompdf is supported with laravel 8 and laravel ui 3.x
or
Please run "Composer update" Command
And Then Run
composer require barryvdh/laravel-dompdf:0.8.5
Hope this will work for you.

Failed to install symfony/mailer because of friendsofsymfony/user-bundle

I have problem in using mailer in symfony. I want to follow the instruction on symfony website. When I write composer require symfony/mailer in the terminal, I get an error:
Using version ^2.1 for friendsofsymfony/user-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "5.0.*"
Your requirements could not be resolved to an installable set of packages.
Problem 1
- friendsofsymfony/user-bundle v2.1.2 requires symfony/form ^2.8 || ^3.0 || ^4.0 -> no matching package found.
- friendsofsymfony/user-bundle v2.1.1 requires symfony/form ^2.8 || ^3.0 || ^4.0 -> no matching package found.
- friendsofsymfony/user-bundle v2.1.0 requires symfony/form ^2.8 || ^3.0 || ^4.0 -> no matching package found.
- Installation request for friendsofsymfony/user-bundle ^2.1 -> satisfiable by friendsofsymfony/user-bundle[v2.1.0, v2.1.1, v2.1.2].
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://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
- It's a private package and you forgot to add a custom repository to find it
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
Installation failed, reverting ./composer.json to its original content.
when I check the symfony version in terminal:
Symfony CLI version v4.11.3 (c) 2017-2019 Symfony SAS
Symfony CLI helps developers manage projects, from local code to remote infrastructure
can you please help me to solve this problem?
I don't know about the symfony 4.11 version.
The last version maintained by symfony is the 4.4.
I think you should work on 4.4 version for more stability.
When you read docs, look at the version. Here there is no doc for symfony 4.11
So you're bundle will probably not work on your version.
On packagist you can see the bundle can work on 4.4 or 5 version.
https://packagist.org/packages/symfony/mailer

Installing Amazon SDK via composer issue

Good day:
I'm running PHP 5.6 and I'm trying to install aws/aws-sdk-php however, getting error:
$ composer require aws/aws-sdk-php
./composer.json has been updated
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
- symfony/translation v4.1.3 requires php ^7.1.3 -> your PHP version (5.6.20) does not satisfy that requirement.
- symfony/translation v4.1.3 requires php ^7.1.3 -> your PHP version (5.6.20) does not satisfy that requirement.
- Installation request for symfony/translation == 4.1.3.0 -> satisfiable by symfony/translation[v4.1.3].
Installation failed, reverting ./composer.json to its original content.
Not sure why I'm getting this issue as aws/aws-sdk-php requires minimum PHP 5.6 however, these dependencies requires php 7. I already have these dependencies installed in my vendor directory (through composer)
"require" : {
"jenssegers/proxy" : "^2.2",
"league/oauth2-client" : "0.12.1",
"zendframework/zend-diactoros" : "^1.7",
"nesbot/carbon" : "^1.22"
}
As #rob006 mentioned, I needed to delete my vendor directly and run composer again.
This main reason for the issue is that I ran composer install initially on a PHP 7 system and then ran it subsequently on php 5.6 which cause the issue. Another fix is to set the platform version of php in the composer.json file.

Replacing Blade with Twig in Laravel 5

I am attempting to swap out Laravel's native Blade Templating for Symfony's Twig Templating Engine. However during the composer require of twigbridge I get the following errors :
Using version ^0.9.5 for rcrowe/twigbridge
./composer.json has been updated
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
- Can only install one of: twig/twig[1.x-dev, v2.4.4].
- Can only install one of: twig/twig[v2.4.4, 1.x-dev].
- Can only install one of: twig/twig[1.x-dev, v2.4.4].
- rcrowe/twigbridge v0.9.5 requires twig/twig ~1.30 -> satisfiable by twig/twig[1.x-dev].
- Installation request for rcrowe/twigbridge ^0.9.5 -> satisfiable by rcrowe/twigbridge[v0.9.5].
- Installation request for twig/twig (locked at v2.4.4, required as ^2.4) -> satisfiable by twig/twig[v2.4.4].
Installation failed, reverting ./composer.json to its original content.
I may be misinterpreting the errors, any suggestions?
You either need to update rcrowe/twigbridge to a newer version that is compatible with twig version 2.4.4, or downgrade twig so that it is compatible with rcrowe/twigbridge v0.9.5.
rcrowe/twigbridge has listed in it's composer.json requirements:
"twig/twig": "~1.30",
edit
I looks like 0.9.5 is that latest version of rcrowe/twigbridge so your only option is using an older version of twig/twig

Laravel new doesn't work in my local environment

I'm trying to create a new laravel app, but when I use the command "laravel new" I've got an error :
laravel new
Crafting application...
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for phpunit/php-token-stream 2.0.0 -> satisfiable by phpunit/php-token-stream[2.0.0].
- phpunit/php-token-stream 2.0.0 requires php ^7.0 -> your PHP version (5.6.30) does not satisfy that requirement. Problem 2
- phpunit/php-token-stream 2.0.0 requires php ^7.0 -> your PHP version (5.6.30) does not satisfy that requirement.
- phpunit/php-code-coverage 4.0.8 requires phpunit/php-token-stream ^1.4.2 || ^2.0 -> satisfiable by phpunit/php-token-stream[2.0.0].
- Installation request for phpunit/php-code-coverage 4.0.8 -> satisfiable by phpunit/php-code-coverage[4.0.8].
Application ready! Build something amazing.
I'm on Windows 10, with php 5.6.30 installed.
I already tried to update composer itself, and laravel's installer (via composer global require "laravel/installer"), but it still doesn't work.
Last time I tried on this computer was three weeks ago, and it worked then.
Edit : I can't change my PHP version since it is the one I use on my server.
It looks like you are trying to download the latest realease of laravel. Though it is 5.4 but for some reason, it is downloading laravel's version that is compatible only with PHP7
Try with composer create-project --prefer-dist laravel/laravel blog "5.4.*" to install laravel 5.4
It's only the phpunit version. Change the version to smaller, like:
"phpunit/phpunit": "~5.7"
to
"phpunit/phpunit": "~5.0"

Categories