wilr / silverstripe-googlesitemaps

Google Sitemaps module for the SilverStripe CMS
BSD 3-Clause "New" or "Revised" License
74 stars 95 forks source link

SS4.4.3 : XML Parsing Error: XML or text declaration not at start of entity #161

Closed EEKimS closed 5 years ago

EEKimS commented 5 years ago

I may be missing something in configuration somewhere, but i am getting this error every time i try to load the sitemaps.

XML Parsing Error: XML or text declaration not at start of entity
Location: http://mysite/sitemap.xml?flush=1
Line Number 2, Column 1:
<?xml version="1.0" encoding="UTF-8"?>
^

the set up steps i did (might be missing something)

  1. I ran the composer command to install
  2. created the googlesitemaps.yml file in the _config folder
  3. ran a dev/build?flush=all
  4. tried to access sitemap.xml?flush=1, ?fush=all, and normally (where it just hangs)

Apologies if this is not enough info, i would be happy to help as i would like to actually be able to use this module.

Please Help :(

EDIT: I should include that currently this is on a Windows 10 / XAMPP setup -- but will be going live onto a linux server

wilr commented 5 years ago

@EEKimS Can you see if there is whitespace prior to the <?xml tag - this may be output if one of your PHP file has trialing whitespace after the ?> tag or before a <?

EEKimS commented 5 years ago

@wilr i looked in your templates and didn't see any whitespaces, if that's what you mean

EEKimS commented 5 years ago

@wilr honestly i don't have any idea what would be generating whitespace anywhere

wilr commented 5 years ago

@EEKimS You may find some scripts online to help with the search to find the whitespace injecting file - i.e https://gist.github.com/AlexChittock/3742356

EEKimS commented 5 years ago

@wilr well i ran that script in the folder, but i guess i am not sure i understand the results - considering it is returning a large chunk of my site's php files that have not cause any issues until now -- including a lot of core vendor files

EEKimS commented 5 years ago

I managed to get the white space removed through an injector extension, but now the page just hangs -- think it has something to do with the stylesheets but there are no errors

EEKimS commented 5 years ago

that issue looks to be firefox not accepting the stylesheet headers or something. renders in chrome. I will close this, not sure if it's something in your list to fix