# Error: Class 'DOMDocument' not found

**URL:** https://forum.getkirby.com/t/error-class-domdocument-not-found/6527
**Category:** Questions
**Tags:** v2
**Created:** [February 3, 2017, 5:56pm UTC](https://forum.getkirby.com/t/error-class-domdocument-not-found/6527 "2017-02-03T17:56:48Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![meltajon](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/meltajon/32/6554_2.png) [@meltajon](https://forum.getkirby.com/u/meltajon)
#### Post date: [February 3, 2017, 5:56pm UTC](https://forum.getkirby.com/t/error-class-domdocument-not-found/6527/1 "2017-02-03T17:56:48Z")

</div>

Hey guys, I’m a total newb trying to migrate my Kirby site to Digital Ocean, and stumbling/learning command line stuff no the way.

On my new Digital Ocean environment, I’m getting the following error:

```
Fatal error: Method Kirbytext::__toString() must not throw an exception, caught Error: Class 'DOMDocument' not found in /var/www/blog_beta/kirby/helpers.php on line 0

```

I saw another post with a similar error earlier that solved it by installing the DOM extension, but from what I understand, the DOM extension is already enabled… (Again, total newb here trying to manage a new environment from command line instead of cPanel)

I also noticed that Kirby requires mbstring, but from what I understand, I have that enabled too.

Here is my phpinfo: [PHP 8.0.19 - phpinfo()](https://beta.meltajon.com/test-phpinfo.php)

Any ideas?

---

<div class="post-metadata">

### Author: ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)
#### Post date: [February 3, 2017, 6:13pm UTC](https://forum.getkirby.com/t/error-class-domdocument-not-found/6527/2 "2017-02-03T18:13:03Z")

</div>

mb\_string seems to be there, but I can’t see anything of DOMDocument in your phpinfo.

---

<div class="post-metadata">

### Author: ![meltajon](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/meltajon/32/6554_2.png) [@meltajon](https://forum.getkirby.com/u/meltajon)
#### Post date: [February 3, 2017, 6:22pm UTC](https://forum.getkirby.com/t/error-class-domdocument-not-found/6527/3 "2017-02-03T18:22:26Z")

</div>

Ah, I saw “DOM” listed there under “Module Authors” so I assumed it was enabled.

Total newb question that I can’t quite figure out from Google: can the DOM Extension be enabled without having to recompile/reinstall PHP 7?

---

<div class="post-metadata">

### Author: ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)
#### Post date: [February 3, 2017, 6:33pm UTC](https://forum.getkirby.com/t/error-class-domdocument-not-found/6527/4 "2017-02-03T18:33:25Z")

</div>

Which linux flavor are using? It seems you can install php-xml like this on Ubuntu

```auto
sudo apt-get install php-xml

```

---

<div class="post-metadata">

### Author: ![meltajon](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/meltajon/32/6554_2.png) [@meltajon](https://forum.getkirby.com/u/meltajon)
#### Post date: [February 3, 2017, 7:37pm UTC](https://forum.getkirby.com/t/error-class-domdocument-not-found/6527/5 "2017-02-03T19:37:30Z")

</div>

I’m running Ubuntu 16.04. I installed php-xml like you suggested but I’m still getting the same DOM error.

Here’s what the install looked like:

```
$ sudo apt-get install php-xml

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libxslt1.1 php7.0-xml
The following NEW packages will be installed:
  libxslt1.1 php-xml php7.0-xml
0 upgraded, 3 newly installed, 0 to remove and 44 not upgraded.
Need to get 259 kB of archives.
After this operation, 968 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://sfo1.mirrors.digitalocean.com/ubuntu xenial/main amd64 libxslt1.1 amd64 1.1.28-2.1 [145 kB]
Get:2 http://sfo1.mirrors.digitalocean.com/ubuntu xenial-updates/main amd64 php7.0-xml amd64 7.0.13-0ubuntu0.16.04.1 [113 kB]
Get:3 http://sfo1.mirrors.digitalocean.com/ubuntu xenial/universe amd64 php-xml all 1:7.0+35ubuntu6 [1,954 B]
Fetched 259 kB in 0s (717 kB/s)
Selecting previously unselected package libxslt1.1:amd64.
(Reading database ... 86130 files and directories currently installed.)
Preparing to unpack .../libxslt1.1_1.1.28-2.1_amd64.deb ...
Unpacking libxslt1.1:amd64 (1.1.28-2.1) ...
Selecting previously unselected package php7.0-xml.
Preparing to unpack .../php7.0-xml_7.0.13-0ubuntu0.16.04.1_amd64.deb ...
Unpacking php7.0-xml (7.0.13-0ubuntu0.16.04.1) ...
Selecting previously unselected package php-xml.
Preparing to unpack .../php-xml_1%3a7.0+35ubuntu6_all.deb ...
Unpacking php-xml (1:7.0+35ubuntu6) ...
Processing triggers for libc-bin (2.23-0ubuntu5) ...
Processing triggers for libapache2-mod-php7.0 (7.0.13-0ubuntu0.16.04.1) ...
Setting up libxslt1.1:amd64 (1.1.28-2.1) ...
Setting up php7.0-xml (7.0.13-0ubuntu0.16.04.1) ...

Creating config file /etc/php/7.0/mods-available/dom.ini with new version

Creating config file /etc/php/7.0/mods-available/simplexml.ini with new version

Creating config file /etc/php/7.0/mods-available/wddx.ini with new version

Creating config file /etc/php/7.0/mods-available/xml.ini with new version

Creating config file /etc/php/7.0/mods-available/xmlreader.ini with new version

Creating config file /etc/php/7.0/mods-available/xmlwriter.ini with new version

Creating config file /etc/php/7.0/mods-available/xsl.ini with new version
Setting up php-xml (1:7.0+35ubuntu6) ...
Processing triggers for libc-bin (2.23-0ubuntu5) ...
Processing triggers for libapache2-mod-php7.0 (7.0.13-0ubuntu0.16.04.1) ...

```

Still getting the same error… 😖

---

<div class="post-metadata">

### Author: ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)
#### Post date: [February 3, 2017, 7:42pm UTC](https://forum.getkirby.com/t/error-class-domdocument-not-found/6527/6 "2017-02-03T19:42:28Z")

</div>

Have you restarted apache?

---

<div class="post-metadata">

### Author: ![meltajon](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/meltajon/32/6554_2.png) [@meltajon](https://forum.getkirby.com/u/meltajon)
#### Post date: [February 3, 2017, 7:47pm UTC](https://forum.getkirby.com/t/error-class-domdocument-not-found/6527/7 "2017-02-03T19:47:13Z")

</div>

Ah, restarted and it works! Thank you!

I feel like I leveled up with my command line skills lol

---

<div class="post-metadata">

### Author: ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)
#### Post date: [February 6, 2025, 4:52pm UTC](https://forum.getkirby.com/t/error-class-domdocument-not-found/6527/8 "2025-02-06T16:52:51Z")

</div>


