0

I am running Calendar 1.8.13 on EE 2.8.1 and I am getting 500 Server Errors and Memory warnings when I try and access calendar event detail pages.

Here is the memory error:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in .../codeigniter/system/libraries/Typography.php on line 306

I tried allocating more memory - up to 512MB but the errors keep coming.

The site was built last year and has worked without issue until recently when the the server errors began happening.

Here is the code for the page:

{exp:calendar:events 
limit="1" 
event_name="{segment_3}"
dynamic="no" }
<h3>{event_title}</h3>

<div id="event-details">

    <h4>When:</h4>
        <p>
      {if event_recurs}
         {exp:calendar:date
            base_date="{segment_4}-{segment_5}-{segment_6}"
            output_date="today"
         }
            {date format="%l, %F %j"} @ {event_start_date format="%g:%i%a"}
         {/exp:calendar:date}
      {if:else}
         {event_start_date format="%l, %F %j @ %g:%i%a"}
      {/if}
   </p>

    <h4>Location:</h4>
    <p>{event_location}
        {if event_address}<br />
            {event_address}
        {/if}
    </p>

    <h4>Admission:</h4>
    <p>{admission}</p>

    <h4>Contact</h4>
    <p>{contact_phone}</p>

{/exp:calendar:events}  

<div id="more-events">
        <h4>More Events</h4>

{exp:calendar:cal 
    calendar_id="11" 
    date_range_start="{segment_3}-{segment_4}-{segment_5}"
    date_range_end="{segment_3}-{segment_4}-{segment_5}"
    pad_short_weeks="n"
    event_limit="3" 
    dynamic="off"}
    <div class="event-mini">
        <span>{event_start_date format="%m.%d"}</span>
        <p><a href="{path='calendar/event'}/{event_id}/">{event_title}</a></p>
     <div class="clearer"></div>
    </div>
{/exp:calendar:cal}

 <p  class="more-events"><a href="{site_url}calendar/">{ More Events }</a> </p>
</div><!-- #more-events -->

</div><!-- end #event-details -->

<div id="event-full-description">
{exp:calendar:events orderby="title" sort="asc" limit="1" event_name="{segment_3}" date_range_start="today" show_months="6" dynamic="off"}
        {event_summary}
    {/exp:calendar:events}  

Any assistance in sorting this out would be appreciated.

  • Is the memory error the same after upping the mem_limit in your php configuration file? If so, did you make sure to restart Apache/Nginx? – jrothafer May 22 '15 at 14:44
  • I only modified the memory in the .admin.php file using: ini_set('memory_limit','512M'); I did not modify it at the server level. – forrest May 22 '15 at 14:48
2

Do not use ini_set()! It is only a temporary value change; after script execution ends the value returns to what is set in your configuartion file, and Solspace Calendar might be curling the server for all we know (I don't use it, I'm sure it's great).

Set the memory_limit higher in your php.ini file. Then make sure to restart Apache/Nginx or whatever your PHP agent is. And admin.php shouldn't be executing on a template page view anyways, so ini_set() wouldn't be your solution unless you made sure it was in index.php. You have a much better chance at testing this by putting

ini_set('memory_limit','512M');

at the beginning of your index.php file, but only use this for testing. If you're concerned about that particular template/page load, you can track down the load path or put a conditional in your index.php to only change the memory_limit if it's hitting a particular page.

| improve this answer | |
  • That worked, I'll check on increasing the memory at the server level. – forrest May 22 '15 at 15:05

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.