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
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
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
Re: [rez] xml session errors after 2.14 upgrade?
By rez - January 11, 2012
?><<?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
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 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
Re: [rez] xml session errors after 2.14 upgrade?
By rez - January 11, 2012
list($csr_slideshowRecords, $csr_slideshowMetaData) = getRecords(array(
'tableName' => 'csr_slideshow',
));
Re: [rez] xml session errors after 2.14 upgrade?
By Jason - January 11, 2012
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/
Re: [Jason] xml session errors after 2.14 upgrade?
By rez - January 11, 2012 - edited: January 18, 2012
Well with membership plugin disabled and using your line of code gives me (looking at the source):
Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxx/public_html/csrxml.php:1) in /home/xxxxx/public_html/csrxml.php on line 11
<?xml version="1.0" encoding="UTF-8"?>
and then my xml file shows the records correctly below that for the first time. Line 11 is the line you changed.
Removing that xml line altogether makes the slideshow work but not when the membership plug is enabled. I get the session error.
Same thing with the original code from dave makes a perfect xml file with doc type and working slideshow without the membership enabled but gives me the original session error of course (where we started) with membership enabled.
Still trying with no luck. I need help getting the xml fixed with membership enabled. thanks.