Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Attempted to load class "DOMDocument" from the global namespace

Tags:

php

Ok so i have set up a new symfony3 project using :

Vagrant----Virtualbox----PHP56----MYSQL55----UBUNTUTRUSTY64.

Everything was working correctly until i make a "composer update". I have this error message and i cannot do anything now

Attempted to load class "DOMDocument" from the global namespace

So i found some proposed solution like "install php-xml" but it is already installed with newest version.

Does anyone have a solution or guide me to the right direction to find one

Many thanks

Nico

like image 729
Nicks Avatar asked Apr 15 '16 11:04

Nicks


3 Answers

Had the same issue with PHP 7.0.9, this worked:

sudo apt-get install php7.0-xml
like image 76
CommonCoreTawan Avatar answered Nov 06 '22 08:11

CommonCoreTawan


You need to install the php-xml for your php version.

If you have php 5.6. you need to install php5.6-xml. It seems the newest version does not work for older versions.

sudo apt-get install php5.6-xml
sudo service apache2 restart
like image 23
pevac Avatar answered Nov 06 '22 06:11

pevac


even sudo apt-get install php-xml works. it takes the current version.

like image 5
Galvani Avatar answered Nov 06 '22 07:11

Galvani