Problem 1 - Conclusion: don't install zendframework/zend-cache - php

I'm create one project...
php composer.phar create-project -sdev zendframework/skeleton-application zf3-helloworld
cd zf3-helloworld/
cp composer.phar zf3-helloworld/
cd zf3-helloworld/
php composer.phar update
I'm use PHP7.2
I installed several packages without problems, however try to install the package zendframework / zend-cache, I get the error:
Using version ^2.8 for zendframework/zend-cache
./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
- Conclusion: don't install zendframework/zend-cache 2.8.2
- Conclusion: don't install zendframework/zend-cache 2.8.1
- Conclusion: don't install zendframework/zend-cache 2.8.0
- Conclusion: don't install zendframework/zend-cache 2.9.x-dev
- Conclusion: remove zendframework/zend-eventmanager 3.1.0
- Installation request for zendframework/zend-cache ^2.8 -> satisfiable by zendframework/zend-cache[2.8.0, 2.8.1, 2.8.2, 2.9.x-dev, 2.8.x-dev].
- Conclusion: don't install zendframework/zend-eventmanager 3.1.0
- zendframework/zend-cache 2.8.x-dev requires zendframework/zend-eventmanager ^2.6.3 || ^3.2 -> satisfiable by zendframework/zend-eventmanager[2.6.3, 2.6.4, 3.2.0, 3.2.1, 3.3.x-dev, 3.2.x-dev, 2.6.x-dev].
- Can only install one of: zendframework/zend-eventmanager[2.6.3, 3.1.0].
- Can only install one of: zendframework/zend-eventmanager[2.6.4, 3.1.0].
- Can only install one of: zendframework/zend-eventmanager[3.2.0, 3.1.0].
- Can only install one of: zendframework/zend-eventmanager[3.2.1, 3.1.0].
- Can only install one of: zendframework/zend-eventmanager[3.3.x-dev, 3.1.0].
- Can only install one of: zendframework/zend-eventmanager[3.2.x-dev, 3.1.0].
- Can only install one of: zendframework/zend-eventmanager[2.6.x-dev, 3.1.0].
- Installation request for zendframework/zend-eventmanager (locked at 3.1.0) -> satisfiable by zendframework/zend-eventmanager[3.1.0].
Installation failed, reverting ./composer.json to its original content.
I'm using the tutorial as a base:
https://olegkrivtsov.github.io/using-zend-framework-3-book/html/en/Zend_Skeleton_Application/Getting_Zend_Skeleton_Application.html

Typically, this occurs because of conflicting versions of packages
I recommend restarting the installation process, because your project is new, I think it is faster than resolving all conflicts.
First, clear the cache and data already installed:
rm -rf composer.lock vendor
php composer.phar clear
Restart installing the package with conflict problem
php composer.phar require zendframework/zend-session
After install anothers packages. Eg:
php composer.phar require zendframework/zend-cache
php composer.phar require zendframework/zend-mvc
php composer.phar require zendframework/zend-db
php composer.phar require zendframework/zend-modulemanager
php composer.phar require zendframework/zend-mvc
php composer.phar require zendframework/zend-mvc-i18n
php composer.phar require zendframework/zend-crypt
php composer.phar require zendframework/zend-escaper
php composer.phar require zendframework/zend-mail
php composer.phar require zendframework/zend-paginator
In the following tutorial that is, I think that marked Y switch instead of N, in answer for minimal installation packages.
Do you want a minimal install (no optional packages)? Y/n
n
But, the clear all data that solution your problem.

Related

PHP Laravel error - Your requirements could not be resolved to an installable set of packages

I'm trying to create laravel project in WSL2 ubuntu. I have the projects folder (www) in the WSL root directory, inside that folder i have laravel_test subfolder. When i run
composer create-project laravel/laravel example-app
but i'm getting an error
Your requirements could not be resolved to an installable set of packages.
How can i slove this issue?
root#LAPTOP-R27NIA9B:~/www/laravel_test# composer create-project laravel/laravel example-app
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? Y
Creating a "laravel/laravel" project at "./example-app"
Installing laravel/laravel (v9.3.5)
- Installing laravel/laravel (v9.3.5): Extracting archive
Created project in /root/www/laravel_test/example-app
> #php -r "file_exists('.env') || copy('.env.example', '.env');"
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires laravel/pint ^1.0 -> satisfiable by laravel/pint[v1.0.0, v1.1.0, v1.1.1].
- laravel/pint[v1.0.0, ..., v1.1.1] require ext-xml * -> it is missing from your system. Install or enable PHP's xml extension.
Problem 2
- phpunit/phpunit[9.5.10, ..., 9.5.x-dev] require ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
- Root composer.json requires phpunit/phpunit ^9.5.10 -> satisfiable by phpunit/phpunit[9.5.10, ..., 9.5.x-dev].
To enable extensions, verify that they are enabled in your .ini files:
- /etc/php/8.1/cli/php.ini
- /etc/php/8.1/cli/conf.d/10-opcache.ini
- /etc/php/8.1/cli/conf.d/10-pdo.ini
- /etc/php/8.1/cli/conf.d/20-calendar.ini
- /etc/php/8.1/cli/conf.d/20-ctype.ini
- /etc/php/8.1/cli/conf.d/20-exif.ini
- /etc/php/8.1/cli/conf.d/20-ffi.ini
- /etc/php/8.1/cli/conf.d/20-fileinfo.ini
- /etc/php/8.1/cli/conf.d/20-ftp.ini
- /etc/php/8.1/cli/conf.d/20-gettext.ini
- /etc/php/8.1/cli/conf.d/20-iconv.ini
- /etc/php/8.1/cli/conf.d/20-phar.ini
- /etc/php/8.1/cli/conf.d/20-posix.ini
- /etc/php/8.1/cli/conf.d/20-readline.ini
- /etc/php/8.1/cli/conf.d/20-shmop.ini
- /etc/php/8.1/cli/conf.d/20-sockets.ini
- /etc/php/8.1/cli/conf.d/20-sysvmsg.ini
- /etc/php/8.1/cli/conf.d/20-sysvsem.ini
- /etc/php/8.1/cli/conf.d/20-sysvshm.ini
- /etc/php/8.1/cli/conf.d/20-tokenizer.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-xml --ignore-platform-req=ext-dom` to temporarily ignore these required extensions.
you should just install ext-xml
sudo apt-get install php-xml
laravel/pint needs this package for running correctly
my answer isn't different from Farid Saravi answer , and it solved my problem too
just want to add the answer for the second problem that appeared to me
mentioning that i'm using linux ubuntu 22.04
Problem 1
Root composer.json requires laravel/pint ^1.0 -> satisfiable by laravel/pint[v1.0.0, ..., v1.2.0].
- laravel/pint[v1.0.0, ..., v1.2.0] require ext-xml * -> it is missing from your system. Install or enable PHP's xml extension.
and its answer
sudo apt-get install php-xml
Problem 2
spatie/laravel-ignition[1.0.0, ..., 1.6.1] require ext-curl * -> it is missing from your system. Install or enable PHP's curl extension.
- Root composer.json requires spatie/laravel-ignition ^1.0 -> satisfiable by spatie/laravel-ignition[1.0.0, ..., 1.6.1].
and its answer
sudo apt-get install php-curl
First, delete the project that gave error when creating. Then
Run sudo apt-get install php8.2-curl
you can change php.8.2-curl according to the PHP version you use.
After this, create a project again. It will be successfully created

Failed to install php-amqplib(RabbitMQ) using composer

I'm trying to use this library. php-amqplib.
composer require php-amqplib/php-amqplib
But I am getting this error:
Using version ^2.11#dev for php-amqplib/php-amqplib
./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 php-amqplib/php-amqplib ^2.11#dev -> satisfiable by php-amqplib/php-amqplib[2.11.x-dev, v2.11.0].
- Can only install one of: phpseclib/phpseclib[2.0.x-dev, dev-master].
- Can only install one of: phpseclib/phpseclib[dev-master, 2.0.x-dev].
- Can only install one of: phpseclib/phpseclib[2.0.x-dev, dev-master].
- Conclusion: install phpseclib/phpseclib 2.0.x-dev
- Installation request for phpseclib/phpseclib dev-master -> satisfiable by phpseclib/phpseclib[dev-master].
I solve this myself. By adding
"php-amqplib/php-amqplib": "^2.6"
in require section in composer.json and run composer update

Homebrew how to install php72-xsl?

I'm trying to install phpdocumentor via composer with the following command:
composer require --dev phpdocumentor/phpdocumentor dev-master
Which throws me the following error:
Problem 1
- Installation request for phpdocumentor/phpdocumentor dev-master -> satisfiable by phpdocumentor/phpdocumentor[dev-master].
- Conclusion: remove phpdocumentor/reflection-docblock 4.3.0
- Conclusion: don't install phpdocumentor/reflection-docblock 4.3.0
- phpdocumentor/phpdocumentor dev-master requires phpdocumentor/reflection-docblock ~2.0 -> satisfiable by phpdocumentor/reflection-docblock[2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5].
- Can only install one of: phpdocumentor/reflection-docblock[2.0.0, 4.3.0].
- Can only install one of: phpdocumentor/reflection-docblock[2.0.1, 4.3.0].
- Can only install one of: phpdocumentor/reflection-docblock[2.0.2, 4.3.0].
- Can only install one of: phpdocumentor/reflection-docblock[2.0.3, 4.3.0].
- Can only install one of: phpdocumentor/reflection-docblock[2.0.4, 4.3.0].
- Can only install one of: phpdocumentor/reflection-docblock[2.0.5, 4.3.0].
- Installation request for phpdocumentor/reflection-docblock == 4.3.0.0 -> satisfiable by phpdocumentor/reflection-docblock[4.3.0].
Searching on Google led me to the following question:
Can't install phpDocumentor via Composer
From the correct answer in the link I provided above, I know that the source of my problem is that I'm missing the XSL for my PHP. However, I don't know how to proceed on installing XSL for PHP 7.2. I'm running on MacOs with Homebrew and I tried to do the following:
brew install php72-xsl
I've noticed there's a xsl inside my php.ini:
;extension=xsl
However, when I uncomment it, I get the following warning:
PHP Startup: Unable to load dynamic library 'xsl' (tried: /usr/local/Cellar/php72/7.2.2_13/lib/php/extensions/no-debug-non-zts-20170718/xsl (dlopen(/usr/local/Cellar/php72/7.2.2_13/lib/php/extensions/no-debug-non-zts-20170718/xsl, 9): image not found)
I've checked and the file does not exist. Actually the whole folder extensions does not exist.
Can someone let me know how I should proceed to install xsl?
Brew-installed package php72 includes the xsl extension. Please undo your manual change to the php.ini.
You seem to have an dependency issue with phpdocumentor/reflection-docblock.
You can try the following
remove phpdocumentor/reflection-docblock from your composer.json
run composer update to update the composer.lock
add your phpdocumentor dependency
composer require --dev phpdocumentor/phpdocumentor
re-add phpdocumentor/reflection-docblock
composer require --dev phpdocumentor/reflection-docblock
If you don't have the phpdocumentor/reflection-docblock dependency in your composer.json, try to delete the composer.lock and the vendor folder
rm -rf vendor composer.lock
Then run composer require --dev phpdocumentor/phpdocumentor
This should resolve implicit version constraints with reflection-docblock

How to find conflicting composer package?

I'm trying to update PHPUnit version on a project I'm going to create based on Cilex. It has PHPUnit version ~3.7. When I run composer require phpunit/phpunit:~6 --dev it prints out:
Problem 1
- Can only install one of: phpunit/php-code-coverage[5.2.2, 1.2.18].
- Can only install one of: phpunit/php-code-coverage[5.2.2, 1.2.18].
- Can only install one of: phpunit/php-code-coverage[5.2.2, 1.2.18].
- phpunit/phpunit 6.3.0 requires phpunit/php-code-coverage ^5.2.2 -> satisfiable by phpunit/php-code-coverage[5.2.2].
- Installation request for phpunit/phpunit ^6.3 -> satisfiable by phpunit/phpunit[6.3.0].
- Installation request for phpunit/php-code-coverage (locked at 1.2.18) -> satisfiable by phpunit/php-code-coverage[1.2.18].
However it won't say which package is the offending one. The composer file is this one.
PS:
Also, I ran composer require php:~7.1 just in case, and it worked, but updating PHPUnit after that still doesn't work.
Require package with --update-with-dependencies
Run
$ composer require phpunit/phpunit:^6.0.0 --update-with-dependencies
to update phpunit/phpunit while updating its dependencies at the same time.
See https://getcomposer.org/doc/03-cli.md#require:
--update-with-dependencies: Also update dependencies of the newly required packages.
List reasons
If this doesn't help, run
$ composer why-not phpunit/phpunit:^6.0.0
to list reasons why the package could not be installed.

Composer: Your requirements could not be resolved while installing Laravel Tracker

I'm trying to install this https://github.com/antonioribeiro/tracker package on my Laravel 5.2 using command:
composer require pragmarx/tracker
But then I get this error:
Your requirements could not be resolved to an installable set of packages.
Using version ^2.0 for pragmarx/tracker
./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 pragmarx/tracker ^2.0 -> satisfiable by pragmarx/tracker[v2.0.0].
- Conclusion: remove ramsey/uuid 3.4.1
- Conclusion: don't install ramsey/uuid 3.4.1
- pragmarx/tracker v2.0.0 requires ramsey/uuid ~2.8 -> satisfiable by ramsey/uuid[2.8.0, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.9.0].
- Can only install one of: ramsey/uuid[2.8.0, 3.4.1].
- Can only install one of: ramsey/uuid[2.8.1, 3.4.1].
- Can only install one of: ramsey/uuid[2.8.2, 3.4.1].
- Can only install one of: ramsey/uuid[2.8.3, 3.4.1].
- Can only install one of: ramsey/uuid[2.8.4, 3.4.1].
- Can only install one of: ramsey/uuid[2.9.0, 3.4.1].
- Installation request for ramsey/uuid (locked at 3.4.1) -> satisfiable by ramsey/uuid[3.4.1].
Installation failed, reverting ./composer.json to its original content.
I don't want to break my application. What should I do?
The new package depends on ramsey/uuid, that line also tells you which versions have been found to satisfy this requirement:
pragmarx/tracker v2.0.0 requires ramsey/uuid ~2.8 -> satisfiable by ramsey/uuid[2.8.0, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.9.0].
It seems that this package is already installed in a newer version, because these lines appears as well:
- Conclusion: remove ramsey/uuid 3.4.1
- Conclusion: don't install ramsey/uuid 3.4.1
Composer sums this up as following:
- Can only install one of: ramsey/uuid[2.8.0, 3.4.1].
Composer cannot install your new package because you have installed ramsey/uuid in a newer version that is incompatible to the required version.
You can try and send a pull request to the maintainer of pragmarx/tracker with the update of ramsey/uuid. Or you can search for a different package that is compatible with your installed packages.

Categories