Magento 2 and PHP Fatal error: Uncaught Error: Class 'DOMDoc

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Magento 2 and PHP Fatal error: Uncaught Error: Class 'DOMDoc

Postby HenriPablo » 22. December 2017 00:03

Greetings,

I have magento2 installed on and when I try to run the setup:upgrade command, I get the following error:

PHP Fatal error: Uncaught Error: Class 'DOMDocument' not found in /opt/lampp/apps/magento/htdocs/vendor/magento/framework/Xml/Parser.php:35

Now, I did see these two questions on stockoverflow (
PHP 7 DomDocument not found - https://stackoverflow.com/questions/35668702/php-7-domdocument-not-found

Class 'DOMDocument' not found - https://stackoverflow.com/questions/14395239/class-domdocument-not-found)
but they don't really provide a solution since the xampp app does not use my php installed outside of the xampp environment. Or am I wrong on that?

Thanks in advance.
HenriPablo
 
Posts: 2
Joined: 21. December 2017 23:56
XAMPP version: 7.0.26-0
Operating System: linux mint

Re: Magento 2 and PHP Fatal error: Uncaught Error: Class 'DO

Postby Nobbie » 22. December 2017 19:49

HenriPablo wrote:but they don't really provide a solution since the xampp app does not use my php installed outside of the xampp environment. Or am I wrong on that?


You are right. Xampp cannot use the extensions of your ubuntu distribution. As Xampp does not support DOM XML, you should not use Xampp. Instead install Apache/PHP/MySQL from the Ubuntu software installer and then install DOM XML as you already tried. This will result in a server installation including DOM XML. You cannot run Xampp and the installation from repository, therefore do not use Xampp for your approach. But Ubuntus server installation are fine and good anyway.
Nobbie
 
Posts: 9885
Joined: 09. March 2008 13:04

Re: Magento 2 and PHP Fatal error: Uncaught Error: Class 'DO

Postby HenriPablo » 22. December 2017 22:10

SOLVED: I realized that the php commands I was executing were run by the php installed on the system, and not the one in use by Xampp. Thus installing the php-xml part solved that issue. I resolved all the subsequent errors in the same way. So far, the app is running ok. Granted, a proper, clean stack would be preferable, but this will do for now.
HenriPablo
 
Posts: 2
Joined: 21. December 2017 23:56
XAMPP version: 7.0.26-0
Operating System: linux mint


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 6 guests