开发者

PHP die PREVENTING White Screen of Death?

开发者 https://www.devze.com 2023-03-19 14:28 出处:网络
I am trying to enumerate through a perfectly valid array using php 5.3.5 on Joomla 1.5.Whenever I try to access the array I get the white screen of death.If I add a die() statement right after then I

I am trying to enumerate through a perfectly valid array using php 5.3.5 on Joomla 1.5. Whenever I try to access the array I get the white screen of death. If I add a die() statement right after then I get the array, (but of course, execution after that is halted). I purposely put no code after array call and die() for debugging purposes. Removing die doesn't echo the array. Has anyone else had this issue before?

Edit: yes, turned error checking on. WSOD is BLANK.

**in the View class:**

$seminarsRefDB =& JFactory::getDBO();
                $seminarsRefQuery = [MYSQL STUFF]
                $seminarsRefDB->setQuery($seminarsRefQuery);
                $seminarsRefList = $seminarsRefDB->loadAssocList();


for($i=0; $i<count($seminarsRefList); $i++) {

$classAppendix = $i;
                $seminarselects[] = JHTML::_('select.genericList', $seminar_options, 'seminar_title[]', 'class="seminardropdown" style="width:200px;"', 'value', 'text', $seminarsRefList[$i]['value'], 'seminar'.$classAppendix);
            };



$this->assignRef('seminarsArray', $seminarselects);


**In the Default Template**

print_r($this->seminarsArray[0]);
die;

END

I have another array called speakersArray which is echoed perfectly. I copied thi开发者_开发百科s code verbatim from the backend of my site where both arrays show no problems.

Used get_included_files and the default template is the last file included, so execution stops there.


You should turn on display_errors and error_reporting to E_ALL so you don't get a white screen of death and have your server tell you what errors it is getting.

It sounds to me that if its a big array and your passing it around, you could be running out of memory at some point in the code. By placing a die right after the array, you may have not hit that threshold yet.


Though iLLin's approach is fine for development testing, this is bad practice for a live site. Assuming you have access to your server, view the error log file to find out what is going on here.

tail -f error_log

0

精彩评论

暂无评论...
验证码 换一张
取 消