Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ixudra's avatar

Problems with missing PHP extensions

Trying to set up a new Puphpet box but having difficulties with it every single time. About 80% of the stuff in my config file works as intended, the rest is just pure mess and a pain to work out. The latest issue is the following:

$ composer install
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for phpunit/phpunit 4.8.21 -> satisfiable by phpunit/phpunit[4.8.21].
    - phpunit/phpunit 4.8.21 requires ext-dom * -> the requested PHP extension dom is missing from your system.
  Problem 2
    - phpunit/phpunit 4.8.21 requires ext-dom * -> the requested PHP extension dom is missing from your system.
    - codeception/codeception 2.1.5 requires phpunit/phpunit ~4.8.0 -> satisfiable by phpunit/phpunit[4.8.21].
    - Installation request for codeception/codeception 2.1.5 -> satisfiable by codeception/codeception[2.1.5].

So naturally I try to change my config file and provision the box once because I don't want to fix it manually now, then forget about it and have to go through this mess all over again. I add the dom extension to the config file, run my vagrant up --provision command once again but then I receive the following error:

 Error: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install php5.6-dom' returned 100: Reading package lists...
==> dev: Building dependency tree...
==> dev: Reading state information...
==> dev: E: Unable to locate package php5.6-dom
==> dev: E: Couldn't find any package by regex 'php5.6-dom'
==> dev: Error: /Stage[main]/Puphpet_php/Puphpet::Php::Module[dom]/Php::Module[dom]/Package[PhpModule_dom]/ensure: change from purged to present failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install php5.6-dom' returned 100: Reading package lists...
==> dev: Building dependency tree...
==> dev: Reading state information...
==> dev: E: Unable to locate package php5.6-dom
==> dev: E: Couldn't find any package by regex 'php5.6-dom'

This is really pissing me off because I constantly run into problems like this. I had the same thing with the imagick extension just hours earlier. Can someone explain to me how this is possible? PHP 5.6 is over one year old now, how can these extensions be "missing"?? And which are the steps I need to follow to fix this?

Thanks

0 likes
4 replies
fideloper's avatar

This might be hidden in a package such as php-xml-parser, I don't think any package specifically named that exists.

I'm not sure how pupphet installs PHP, but I know that when building it manually, enabling/disabling DOM is one of the options. It usually is installed with PHP "out of the box" to my knowledge.

ixudra's avatar

Well I solved it by adding the xml extension, which took care of the problem. This solved this specific issue but the overall problem is still there though: e.g the Imagick extension still can't be installed right out of the box, even though it's a predefined option in the Puphpet UI (same error as above).

So my question remains: is there a manual somewhere that can explain to me how this is possible, what packages are common and/or how I an avoid possible problems like this in the future?

fede90's avatar

sudo apt-get install php-xml

did the trick for me

5 likes

Please or to participate in this conversation.