8

Warning: DOMDocument::loadXML(): Empty string supplied as input in C:\xampp\htdocs\Magento2\vendor\magento\module-config\Model\Config\Structure\Reader.php on line 132

4
  • Check system.log file in log folder. Aug 30, 2016 at 11:49
  • I am not finding any issue there! :( Aug 30, 2016 at 11:52
  • 1
    check your module xml file, you have something missing inside xml file. or you have to forgot close tag Aug 30, 2016 at 12:02
  • your issue is related to your xml file mismatch tag or some missing node Aug 30, 2016 at 12:46

5 Answers 5

16

I experienced the same kind of issues. I fixed that issue by remove spacing at start of the xml file.

don't give any space at start of the xml file

<?xml version="1.0"?>
...................
..............

it should be

<?xml version="1.0"?>
...................
..............

if it is not solve your problem, show your module.xml

1
  • 1
    It might also be an empty XML file somewhere. I deleted an XML file but the file was put back by some merge but without the contents. Both cases are invalid XML which throws erorrs.
    – Jacques
    Oct 3, 2017 at 13:18
5

I found this problem when learning to build modules. Don't pre configuring the files and folder with empty .xml files, be sure to only create an .xml file with correct content and save it. Don't just leave them empty with a view of populating later as magento's error handling will just fall-over.

1

There is an empty .xml file in you project and If you don't know where is empty file and you are using linux. Use this command to get list of empty files.

open terminal and type

find /path/to/dest -type d -empty for dir.

and

find /path/to/dest -type f -empty for file.

1
  • 1
    for files, use f: find /path/to/dest -type f -empty Nov 14, 2021 at 10:21
0

i just encountered this problem and it took me a couple hours for it to finally become enabled. I found that by deleting excess files from the demo file structure example and using the bare minimum for the purposes of getting things going worked for me.

like so:

app/code/Vendor/Test/etc/module.xml

                    Test/composer.json

                    Test/registration.php

While trying to work this out. I tweaked many things. In my last run before it finally worked. I made sure I changed the autoload in the composer to read "PSR-4" to read name\type(a module in this case)and the name.

like so

"Gary\\ModuleTest"

I also got rid of a line space in between

<?php

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,

in my registration.php

like so:

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,

after that i enabled it and upgraded using php bin/magento setup:upgrade.

0

If this issue exists only in Internet Explorer browser, then the possible cause of this issue is due to it's Compatibility View Settings

Turn OFF "Display intranet sites in Compatibility View" under Settings > Compatibility View Settings

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.