I have index template for my events like so:

              SHOW DAY LISTING
{if segment_2=="day"}


{if:elseif segment_1=="events" AND segment_2=="month"}

          SHOW CALENDAR VIEW (index)

{if:elseif segment_2=="cal"}


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] 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] 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">
        {if segment_3 == ''}
        {if segment_3 != ""}

         <div id="month-header">

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

     <br style="clear:both">

                        <div class="wrap">
                            <table id="fc_inner">
                                    <tr id="days_of_week">
                                        <th class="day_of_week {day_of_week}">
                                        {if day_in_current_month}
                                            <td class="day_cell">
                                                <div class="date">

                                                        {date format="%j"}

                                            <td class="day_cell out_of_range">
                                                <div class="date">
                                                <span class="num">
                                                    {date format="%j"}
                                                    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}
                                                {if event_multi_day}
                                                    {if event_all_day == FALSE}
                                                        {if event_first_day}
                                                        {if event_last_day}
                                                    <a href="{path='calendar/events'}/{event_id}/">{event_title}</a>
                                                    {if event_all_day == ''}
                                                        {event_start_date format="%g"}
                                                        {if event_start_minute > 0}
                                                        {if event_end_time != event_start_time && event_end_time != '00:00'}
                                                            {event_end_date format="%g"}
                                                            {if event_end_minute > 0}
                                                            {event_end_date format="%a"}
                                                            {event_start_date format="%a"}
                                                     <a href="/events/view/{url_title}/">{event_title}</a>


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

  • 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.