Element API: PHP Error: Fatal error: Allowed memory size of 33554432 bytes exhausted Trying to get this json api to work for us and keep running into issues. Here, when trying to list all items, it throws the following PHP error:


  Fatal error:  Allowed memory size of 33554432 bytes exhausted (tried to allocate 65552 bytes) in /home/accesstrucks/craft/app/framework/YiiBase.php on line 618


There are only 100 listings currently, but this is just for testing. Which is nothing compared to how many listings there will be when live. 

Here's my code: 

return [
  'endpoints' =&gt; [
    'alltrucks.json' =&gt; [
      'elementType' =&gt; 'Entry',
      'criteria' =&gt; ['section' =&gt; 'trucks'],
      'paginate' =&gt; false,
      'transformer' =&gt; function(EntryModel $entry) {
        return [
          $entry-&gt;year.' '.$entry-&gt;manufacturer.' '.$entry-&gt;model,
          (string)$entry-&gt;author,
          !empty((string)$entry-&gt;category[0]) ? (string)$entry-&gt;category[0] : null, 
          !empty($entry-&gt;listingPhotos[0]-&gt;url) ? str_replace('/images/uploads/listings/', '', $entry-&gt;listingPhotos[0]-&gt;url) : null,
          ($entry-&gt;saleType=='new') ? '0' : '1',
          (string)$entry-&gt;featured,
          ($entry-&gt;saleType-&gt;label=='new') ? '0' : '1',
          $entry-&gt;transmission,
          (string)$entry-&gt;dateUpdated,
          $entry-&gt;mileage,
          $entry-&gt;price
Your php.ini file's memory_limit setting is set to 32M.

You'll want to bump that up to something higher like 256M.