sruupl / batflat

Lightweight, fast and easy CMS for free. Bootstrap ready. https://batflat.org
MIT License
134 stars 54 forks source link

Sitemap plugin - Error #37

Closed KonstantinFromRussia closed 4 years ago

KonstantinFromRussia commented 5 years ago

I activate the sitemap module. I go to the site address - mysite/sitemap.xml and get an error 500 sitemap-error

klocus commented 5 years ago

Can you activate DEV_MODE in inc/core/defines.php?. Please check for some errors.

sim2github commented 5 years ago

Returned error in red frame:

This page contains the following errors:
error on line 2 at column 1: Extra content at the end of the document
Below is a rendering of the page up to the first error.
KonstantinFromRussia commented 5 years ago

My Lords !!! I am taking a clean distribution system from a github. I unpack it on the server. I start, I go to the admin area, turn on the sitemap plugin. I do not make any additional entries. Then I look at adress: http://u14445mo3.ha002.t.justns.ru/sitemap.xml You can try it yourself. Login and password admin panel are standard, I haven't changed them I can give a link to FTP

**// Developer mode
define('DEV_MODE', true);**
klocus commented 5 years ago

Can you provide me this file: /u14445mo3.ha002.t.justns.ru/public_html/tmp/sitemap.xml?

KonstantinFromRussia commented 5 years ago

I can

<?xml version="1.0" encoding="UTF-8"?>
<urlset
      xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
            http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<?php $counter = 0; foreach (cv($urls) as $key => $value): ?>
<url>
    <loc><?php echo cv($value)['url']; ?></loc>
    <?php if (!empty($value['lastmod'])): ?><lastmod><?php echo cv($value)['lastmod']; ?></lastmod><?php endif; ?>

</url>
<?php $counter++; endforeach; ?>
</urlset>
klocus commented 5 years ago

Set the config option short_open_tag in php.ini to 0 or Off and restart Apache.

KonstantinFromRussia commented 5 years ago

Thanks! It works. Will this parameter affect other sites on my server?

KonstantinFromRussia commented 5 years ago

A simpler solution to this problem. Add the following code to the .htaccess file:

<IfModule mod_php5.c>
 php_flag short_open_tag off
</IfModule>
sim2github commented 5 years ago

Maybe this solution cover short tag problem #39 ?

sim2github commented 5 years ago

RSS in blog module blog/feed/en_english has same problems.

vithultnair commented 4 years ago

A simpler solution to this problem. Add the following code to the .htaccess file:

<IfModule mod_php5.c>
 php_flag short_open_tag off
</IfModule>

This didn't fix my issue! /sitemap.xml gives a 500 error.

blog/feed/en_english this also returns 500 error!

Is the issue fixed or not yet?