0

I have index template for my events like so:

{!--------------------------------------------------
              SHOW DAY LISTING
--------------------------------------------------}
{if segment_2=="day"}
{embed="events/_view-day"}

{!--------------------------------------------------
          SHOW THE SPECIFIC MONTH
--------------------------------------------------}

{if:elseif segment_1=="events" AND segment_2=="month"}
{embed="events/_view-month"}


{!--------------------------------------------------
          SHOW CALENDAR VIEW (index)
--------------------------------------------------}

{if:elseif segment_2=="cal"}
{embed="events/calendar"}

{!--------------------------------------------------
              SHOW THE CURRENT MONTH
--------------------------------------------------}
{if:else}
 {embed="events/_view-current-month}
 {/if}

I have this exact, advanced calendar implementation on the 3rd rule here at /events/cal http://www.solspace.com/docs/calendar/month//#examples

The strange thing is I'm using this template base for 5 sites. Only one of them is experiencing issues with the 500 error. My log has:

[Thu May 01 11:35:35 2014] [warn] [client 174.59.51.74] mod_fcgid: read data timeout in 45     seconds, referer: http://figlancaster.com/events/month/06/2014
[Thu May 01 11:35:35 2014] [error] [client 174.59.51.74] Premature end of script headers: index.php, referer: http://figlancaster.com/events/month/06/2014

I tried logging in as root and bumped up the settings per this article:

mod_fcgid: read data timeout in 45 seconds --> Premature end of script headers: admin.php

However, still no difference.

All of the php memory limits for all the site using this template base is 256M

Any thoughts? This is driving me nuts.

Update: My /events/calendar template. The only modification I made was the segments for the date range.

    <div id="fc_calendar">
        {exp:calendar:cal
        {if segment_3 == ''}
            date_range_start="year-month-01"
            date_range_end="year-month-last"
        {/if}
        {if segment_3 != ""}
            date_range_start="{segment_5}-{segment_4}-01"
            date_range_end="{segment_5}-{segment_4}-last"
        {/if}
        }
        {display_each_month}

         <div id="month-header">

     <div class="last_month"> 
           <a href="{path='/events/cal/month'}/{prev_month format="%m/%Y"}/">
                            {prev_month format="%F"}
                        </a>
        </div>
        <div style="float: left; width: 60%; text-align: center;">
               <h2>{date format="%F %Y"}</h2>
        </div>
        <div  class="next_month">
          <a href="{path='/events/cal/month'}/{next_month format="%m/%Y"}/">
                            {next_month format="%F"}
                        </a>
        </div>


     <br style="clear:both">
     </div>



                        <div class="wrap">
                            <table id="fc_inner">
                                <thead>
                                    <tr id="days_of_week">
                                        {display_each_day_of_week}
                                        <th class="day_of_week {day_of_week}">
                                            {day_of_week}
                                        </th>
                                        {/display_each_day_of_week}
                                    </tr>
                                </thead>
                                <tbody>
                                    {display_each_week}
                                     <tr>
                                        {display_each_day}
                                        {if day_in_current_month}
                                            <td class="day_cell">
                                                <div class="date">

                                                        {date format="%j"}

                                                </div>
                                        {if:else}
                                            <td class="day_cell out_of_range">
                                                <div class="date">
                                                <span class="num">
                                                    {date format="%j"}
                                                </span>
                                            </div>
                                        {/if}
                                        {display_each_hour}
                                            {events}
                                                <div
                                                  class="
                                                    event {if event_all_day}all_day{/if}
                                                    {if event_multi_day}multi_day{/if}
                                                    {if event_first_day}first_day{/if}
                                                    {if event_last_day}last_day{/if}
                                                    {if all_day_event_index_difference > 0}
                                                        index_difference_{all_day_event_index_difference}
                                                    {/if}
                                                  ">
                                                {if event_multi_day}
                                                    {if event_all_day == FALSE}
                                                        {if event_first_day}
                                                            {event_start_time}
                                                        {/if}
                                                        {if event_last_day}
                                                            {event_end_time}
                                                        {/if}
                                                    {/if}
                                                    <a href="{path='calendar/events'}/{event_id}/">{event_title}</a>
                                                {if:else}
                                                    {if event_all_day == ''}
                                                        {event_start_date format="%g"}
                                                        {if event_start_minute > 0}
                                                            :{event_start_minute}
                                                        {/if}
                                                        {if event_end_time != event_start_time && event_end_time != '00:00'}
                                                            &ndash;
                                                            {event_end_date format="%g"}
                                                            {if event_end_minute > 0}
                                                                :{event_end_minute}
                                                            {/if}
                                                            {event_end_date format="%a"}
                                                        {if:else}
                                                            {event_start_date format="%a"}
                                                        {/if}
                                                    {/if}
                                                     <a href="/events/view/{url_title}/">{event_title}</a>
                                                {/if}
                                                </div>
                                                {/events}
                                            {/display_each_hour}
                                        </td>
                                        {/display_each_day}
                                    </tr>
                                    {/display_each_week}
                                </tbody>
                            </table>

        {/display_each_month}
        {/exp:calendar:cal}
    </div>

Non-working URL: http://figlancaster.com/events/cal Note: This is a list view of the events I"m attempting to load into the calendar. There are probably roughly 150 or so: http://figlancaster.com/events Working URL loading the same template but less events: http://www.figbethlehem.com/events/cal

Both sites are running EE v2.5.2 and Calendar 1.8.6

7
  • You're using an advanced conditional, which means all embeds are being called. If in each embed template, you have complex Calendar code, or simply a large number of event data, this could slow down the page enough to give you the 500 error. Consider using another method to avoid advanced conditionals, such as using simple conditionals (see EE docs for details), or a plugin that prevents all embeds from loading, such as Stash or Switchee.
    – Solspace
    May 2 '14 at 1:35
  • If the issue is a specific embed/piece of code, try using each embed, alone, on the template until you have one that causes the 500 error. Then, note the URL, code, and Calendar version that you are using, and add this info by editing this OP.
    – Solspace
    May 2 '14 at 1:37
  • I know which template it is. It's the event/calendar template. I made edits to my original post to show the actual problematic template.
    – Jon Nixon
    May 3 '14 at 0:30
  • Would Template Morsels help maybe?
    – Jon Nixon
    May 3 '14 at 1:50
  • I tried the above code on a template, and didn't have issues. If you put the code in event/calendar alone, on a completely, absolutely blank EE template with nothing whatsoever on it besides the code, do you get the 500 error? How much PHP memory do you have set up? Have you tried increasing it? If the issue is a performance issue (eg. too slow to load all data), Template Morsels could be useful, but always make sure you optimized your templates as much as possible before that.
    – Solspace
    May 5 '14 at 2:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.