Module

Developer
Supported

Sitemap Module

ExpressionEngine 3, ExpressionEngine 4, ExpressionEngine 5

Back to this add-on's main page
View Other Add-ons From PutYourLightsOn

     

You must be logged in to post.

Error after installation

Support Request

Rob H
Rob H

Hi,

We have installed the Site Map module to a temp URL on Heart Internet shared hosting and we are getting a error when trying to view the page.

This page contains the following errors:

error on line 1 at column 1: Extra content at the end of the document
Below is a rendering of the page up to the first error.

We have tried re installing and checked the permissions.

Any help would be greatly appreciated.

Thanks,
Rob

fiunary
# 1
fiunary

Hi, I am having this issue too.  The sitemap is there and great but there is an empty space at the front of the declaration.

fiunary
# 2
fiunary

I saw another post about this which was solved by uploading a newer version of mod.sitemap.php which contained a bug fix.  I tried this an it didn’t work.  I was upgrading and I wonder whether the version on the PutYouLightsOn site has been upgraded?  I have php off.

fiunary
# 3
fiunary

Found the issue - a trailing space in my template - sorry about that.

PutYourLightsOn
# 4
Developer
PutYourLightsOn

ah yes, gotta watch out for those rogue spaces!

PutYourLightsOn
# 5
Developer
PutYourLightsOn

rob does this also solve your issue?

Abe
# 6
Abe

Hi, I’m working with Rob on this project and have progressed past this problem but found another.

The original problem was that our site is at a temp address so homepage is http:// xxx.xxx.xxx.xx /oursitename.com/index.php, so to fix it I simply changed

$sitemap_url 'http://'.$_SERVER["HTTP_HOST"].'/index.php/'.$template

To

$sitemap_url 'http://'.$_SERVER["HTTP_HOST"].'/politicsdirect.com/index.php/'.$template

So now I have the problem of the sitemap.php page just producing a blank page. If you take a look at the sitemap here (http://79.170.44.138/politicsdirect.com/sitemap.php) you’ll see it is blank however our template file produces the URLs that have been selected in the back-end (http://79.170.44.138/politicsdirect.com/index.php/sitemap).

To test the right URL was being used I tried echoing out $sitemap_url, which kept throwing this error “error on line 1 at column 1: Document is empty”. After removing the header line it correctly echoed out $sitemap_url, which was the correct address of http://79.170.44.138/politicsdirect.com/index.php/sitemap.

Some of that may be nothing to do with the problem but just including so you have as much info as possible.

Any solutions please let me know.

PutYourLightsOn
# 7
Developer
PutYourLightsOn

hi abe,

i would suggest that you hardcode the url in as follows:

$sitemap_url 'http://79.170.44.138/politicsdirect.com/index.php/sitemap'

let me know how that works out for you.

Abe
# 8
Abe

Hi, thanks for your reply but it still seems to be having problems.

I have tried that and no success, it seems again we are getting the error “error on line 1 at column 1: Extra content at the end of the document”.

However I have now added an error output using:

$err   = curl_errno( $curl_handle );
$errmsg = curl_error( $curl_handle );

When echoing out the contents the errno is 7 (which I have looked up as “Failed to connect() to host or proxy.”) and the error message is always empty. Strangely the errno can be seen when echo’ed out in Firefox but not chrome, guess this is just to do with the way they deal with XML.

Any ideas why it might not be able to connect? I doubt that it is but could it be to do with it not being the ‘root’ directory that the file is executing from?

Abe
# 9
Abe

After further looking there was a suggestion to run the file locally connecting to the remote EE created page, and this ran fine so it is obviously something to do with our server setup.

I have very little experience with cURL so if anyone has suggestions as to why or where to look for the settings I need to adjust then please let me know.

Abe
# 10
Abe

Right just got a reply from our hosting company that is saying cURL internal connections i.e a connection from our server to our server, is blocked to protect internal security.

I noticed there is the “readfile” method as a fallback for if cURL is disabled, however when I have attempted just to make this the default method that is used I get no output.

Is there a method you can recommend for outputting the file? Aside from cURL of course.

Thanks, Abe.

PutYourLightsOn
# 11
Developer
PutYourLightsOn

readfile should work, or is that disabled by your web host too? perhaps they can suggest a workaround?

Abe
# 12
Abe

Hm I couldn’t seem to get it to work, I have replied asking them for a suggestion.

However I had a thought, what exactly is the purpose of the sitemap.php when it is just outputting the template file that is generate at xxxx/index.php/home/sitemap . Is it just to create the correct header so it is properly formatted as a XML file?

Believing this is the case I have changed the template’s file type to XML (in EE back-end) so it is generating a properly formatted file check http://79.170.44.138/politicsdirect.com/index.php/sitemap .

So would I be correct in thinking I can submit this to google and get the same effect or must i submit a file based in the root folder?

Thanks for you help again, Abe.