Php prompt DOMDocument not found

this is my phpinfo screenshot (sg"s picture system is temporarily down)
http://i1.bvimg.com/517892/cd.
I seem to have installed an earlier version of dom, from phpinfo, but when I new DOMDocument in the PHP file, I prompt Class" XXX\ DOMDocument" not found.
I"ve tried yum php-xml, and then adding extension=dom.so, to php.ini is useless. And at the same time, the php.info information has not changed. How should I configure DOM?? Thank you, bosses.

< hr >

update, does it matter if I have namespace App\ Http\ Controllers; before my PHP file?
I changed new DOMDocument () to new\ DOMDocument () is also useless, error Class" AppHttpControllersDOMDocument" not found.

Php
Mar.07,2021

answer for yourself. Namespace, is set at the beginning of the PHP file, so it is invalid to use new DOMDocument (), and it is not possible to add\ before it.
solution: just add a use\ DOMDocumemt;.


what is XXXXXXXXX? screenshot


$dom = new \DOMDocument();
Menu