1

I'm working with PHP client code that includes a Symfony dom-crawler (added via composer). It works great when run from the command line; however, when debugging it will crash with the following error:

PHP Fatal error:  Uncaught Error: Class 'DOMDocument' not found in /home/jeff/newproject/vendor/symfony/dom-crawler/Crawler.php:189

I'm using PHP 7.1, Eclipse, Xdebug on Ubuntu. I'm experiencing the same issue with another dependency as well so I suspect it's Eclipse/Xdebug related.

Any ideas where to start looking?

Update: I ensured php-xml is the latest version:

$ sudo apt-get install php7.1-xml
Reading package lists... Done
Building dependency tree       
Reading state information... Done
php7.1-xml is already the newest version (7.1.13-1+ubuntu16.04.1+deb.sury.org+1).
0 upgraded, 0 newly installed, 0 to remove and 41 not upgraded.
1
  • 4
    Make sure that the xml extensions are installed/enabled, specifically php-xml . Commented Feb 5, 2018 at 16:14

1 Answer 1

2

On Linux (and OSX) make sure that on eclipse php configuration you checked "Use system default php.ini configuration". Without this files from /etc/php-version/conf.d/*.ini will not be loaded, so also XML will be not available.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.