1

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:

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?

Chin Leung
  • 14,621
  • 3
  • 34
  • 58

1 Answers1

1

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

Michel Feldheim
  • 17,625
  • 5
  • 60
  • 77
  • Hmm... However I have no `phpdocumentor/reflection-docblock` inside my `composer.json`. Running `composer update` and re-run the install command leads to same error. I've also undone the manual change to my `php.ini`. – Chin Leung Feb 06 '18 at 16:13
  • Removing the `vendor` and `composer.lock` solved the problem! Thanks. – Chin Leung Feb 06 '18 at 16:34
  • 2
    Also be aware of the possibility of phpdocumentor and phpunit both having dependencies on *different* versions of reflection-docblock, which can sometimes block the two from installing side by side. This could also manifest itself on type-resolver or reflection-common, but I see it happen more often against reflection-docblock. – ashnazg Feb 07 '18 at 12:07