Homebrew how to install php72-xsl? - php

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

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

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

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.

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.

upgrading yii2 advanced from 2.0.6 to 2.0.7 does not work

In my project directory I first executed the following two commands
php C:\ProgramData\ComposerSetup\bin\composer.phar self-update
php C:\ProgramData\ComposerSetup\bin\composer.phar global require "fxp/composer-asset-plugin:~1.1.1"
But executing the command
composer require yiisoft/yii2 2.0.5
yields:
Your version of PHP, 5.4.7, is affected by CVE-2013-6420 and cannot safely perform certificate validation, we strongly suggest you upgrade.
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
./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 yiisoft/yii2 2.0.7 -> satisfiable by yiisoft/yii2[2.0.7].
- Conclusion: remove bower-asset/jquery.inputmask 3.1.63
- Conclusion: don't install bower-asset/jquery.inputmask 3.1.63
- yiisoft/yii2 2.0.7 requires bower-asset/jquery.inputmask ~3.2.2 -> satisfiable by bower-asset/jquery.inputmask[3.2.7, 3.2.6, 3.2.5, 3.2.4, 3.2.3, 3.2.2].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.7].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.6].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.5].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.4].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.3].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.2].
- Installation request for bower-asset/jquery.inputmask (locked at 3.1.63) -> satisfiable by bower-asset/jquery.inputmask[3.1.63].
Installation failed, reverting ./composer.json to its original content.
Any help?
Upgrade from Yii 2.0.6 to Yii 2.0.7, Pls visit this link
Added new requirement: ICU Data version >= 49.1. Please, ensure that your environment has ICU data installed and up to date to prevent unexpected behavior or crashes. This may not be the case on older systems e.g. running Debian Wheezy.

Unable to install laravel 5 on windows via composer

I am trying to get started with laravel on windows and here is the command I tried:
rahul#rahulserver MINGW64 /d/PhpIdeaProjects/LaravelLearning
$ composer create-project laravel/laravel learning-laravel-5
Here is the output I get:
Installing laravel/laravel (v5.0.22)
- Installing laravel/laravel (v5.0.22)
Loading from cache
Created project in learning-laravel-5
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 danielstjules/stringy 1.9.0 -> satisfiable by danielstjules/stringy[1.9.0].
- danielstjules/stringy 1.9.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
Problem 2
- Installation request for laravel/framework v5.0.16 -> satisfiable by laravel/framework[v5.0.16].
- laravel/framework v5.0.16 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
So how shall I move on and have it working?
The requested dependencies require the php extension mbstring as the error explains.
the requested PHP extension mbstring is missing from your system
So install the extension and it should install flawless.
mbstring is built in the libapache2-mod-php5 package. Run
sudo apt-get install libapache2-mod-php5
For windows environments check your php.ini and uncomment the line ;extension=php_mbstring.dll to extension=php_mbstring.dll - then restart your webserver.

Categories