xml session errors after 2.14 upgrade?

11 posts by 2 authors in: Forums > CMS Builder
Last Post: January 12, 2012   (RSS)

By rez - January 11, 2012

I havent' changed any page code that I recall and just noticed my slideshows were down. It appears that the xml files arent working.

What I did do is install 2.14 and 1.06 website plugin and tested the plug. I didn't look at the slideshows before the upgrade but dont recal or havent had any complaints about them being down. Here is the error on the xml.php page:
Couldn't start session! 'session_start(): Cannot send session cache limiter - headers already sent (output started at /home/xxxxx/public_html/xml.php:1)'!

<?php


// load viewer library
$libraryPath = 'cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = array('/home/xxxxx/public_html/','','../','../../','../../../');
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }

// load records
list($csr_slideshowRecords, $csr_slideshowMetaData) = getRecords(array(
'tableName' => 'csr_slideshow',
));


?><<?php ?>?xml version="1.0" encoding="utf-8"?>
<SlideshowBox>
<items>
<?php foreach ($csr_slideshowRecords as $record): ?>
<item>
<?php foreach ($record['slide'] as $upload): ?>
<thumbnailPath><?php echo $upload['thumbUrlPath2'] ?></thumbnailPath>
<largeImagePath><?php echo $upload['thumbUrlPath'] ?></largeImagePath>
<fullScreenImagePath><?php echo $upload['urlPath'] ?></fullScreenImagePath>
<?php endforeach ?>
<title><?php echo $record['title'] ?></title>
<description>
<![CDATA[<?php echo $record['dsc'] ?>]]>
</description>
</item>
<?php endforeach ?>
</items>
</SlideshowBox>



thanks for the support.

Re: [rez] xml session errors after 2.14 upgrade?

By Jason - January 11, 2012

Hi,

This type of error is usually caused by there being something at the top of the page before the first <?php tag. This is normally just a blank line. What happens is that blank line is interpreted by server as output, and put in the output buffer. If there is already output, you can't create a session, which is what the membership plugin is attempting.

Try making sure that your <?php tag is at the very top of the page. That should take care of the issue.

Thanks
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] xml session errors after 2.14 upgrade?

By rez - January 11, 2012

Definitely nothing before the opening php tag. It's the first and only thing on the line with nothing before it. :/

Re: [rez] xml session errors after 2.14 upgrade?

By rez - January 11, 2012

Is it something to do with:

?><<?php ?>?xml version="1.0" encoding="utf-8"?>

That was a trick Dave showed me when I think I had trouble getting that line to show up or something. (would have to look up my old thread).

Re: [rez] xml session errors after 2.14 upgrade?

By Jason - January 11, 2012

Hi,

It's strange that it's telling you that there is output coming from line 1. Could you attach the .php file your working with so I can take a closer look at your code?
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [rez] xml session errors after 2.14 upgrade?

By rez - January 11, 2012

I just used the same slideshow xml code from a working site with another version of CMSB. It only gives the error on this site.

I could be wrong but this seems to back up the fact that these slideshows worked until upgrade?

Re: [Jason] xml session errors after 2.14 upgrade?

By rez - January 11, 2012 - edited: January 11, 2012

Oh... I see what you mean, The page is attached.
Attachments:

csrxml.php 2K

Re: [rez] xml session errors after 2.14 upgrade?

By rez - January 11, 2012

note, I forgot to change the list code when copying from my other site but still not getting past that error.

list($csr_slideshowRecords, $csr_slideshowMetaData) = getRecords(array(
'tableName' => 'csr_slideshow',
));

Re: [rez] xml session errors after 2.14 upgrade?

By Jason - January 11, 2012

Hi,

My guess would be that your other site isn't running Website Membership, which is why it isn't running into any session errors.

Try this change:

<?php
$libraryPath = 'cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = array('/home/xxxx/public_html/','','../','../../','../../../');
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }

// load records
list($slideshowRecords, $slideshowMetaData) = getRecords(array(
'tableName' => 'csr_slideshow',
));

?>
<?php header('Content-type: application/xml; charset=utf-8'); ?><?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>
<SlideshowBox>
<items>
<?php foreach ($csr_slideshowRecords as $record): ?>
<?php foreach ($record['slide'] as $upload): ?>
<item>
<thumbnailPath><?php echo $upload['thumbUrlPath2'] ?></thumbnailPath>
<largeImagePath><?php echo $upload['thumbUrlPath'] ?></largeImagePath>
<fullScreenImagePath><?php echo $upload['urlPath'] ?></fullScreenImagePath>
<title><![CDATA[<?php echo $upload['title'] ?>]]></title>
<description><![CDATA[<?php echo $upload['dsc'] ?>]]></description>
</item>
<?php endforeach ?>
<?php endforeach ?>
</items>
</SlideshowBox>


Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/