+ Reply to Thread
Results 1 to 2 of 2

Thread: zend_form -> Allowed memory size exhausted

  1. #1
    meph is offline Junior Member
    Join Date
    Nov 2008
    Posts
    1

    Unhappy zend_form -> Allowed memory size exhausted

    Hello there. I'm learning ZF and trying rebuild my projects using this framework.
    So, i've made simple app: table from DB with links edit/delete/add. I've written this app on winXP(php5, apache2) and all works good. But yesterday i transfered my app to server(debian, php5, apache1 and apache2 try too) and got fatal error "Allowed memory size of 67108864 bytes exhausted (tried to allocate 134993477 bytes)". This error happens when i try output form(without data from DB), so table from DB works good.
    IndexController code:
    Code:
    		$this->view->title = "Add Item";
    		$form = new ItemForm();
    	        $this->view->form = $form;
    ItemForm code:
    Code:
    class ItemForm extends Zend_Form
    {
      public function __construct($options = null)
      {
        parent::__construct();
        $this->setName('item');
        ...
        $title = new   Zend_Form_Element_Text('title',array('disableLoadDefaultDecorators' => true,'class'=>'title'));
        $title->setRequired(true)
        ->addFilter('StripTags')
        ->addFilter('StringTrim')
        ->addValidator('NotEmpty');
    
        $this->addElements(array($id, $name, $title, $submit));
        $this->title->addDecorator('viewHelper')
        ->addDecorator('errors');
        ...
    }
    }
    View code:
    Code:
    <form action="" method="post">
    <table>
    <tr>
    	<td>Item title:</td>
    	<td><?php echo stripslashes($this->form->title); ?></td>
    </tr>
    ...
    </table>
    </form>
    What do you think about this? Why this code works on Win and doesn't work on Unix? Can you give me advice (maybe some features in configuration unix server?)?

  2. #2
    Tekerson is offline Senior Member
    Join Date
    Jul 2008
    Posts
    288

    Default

    The error is exactly as the message says, PHP is running out of it's allocated memory.

    I can't see anything in the snippet you've given that look particularly memory hungry, but something is using enough.

    If it was working on a different server (windows or otherwise), I would guess the php configuration is different. The relevant php.ini is "memory_limit" which defaults to 128M (PHP: Description of core php.ini directives - Manual), but your debian config changes that to 64M (apparently, I thought their default was less than that, but that's what your error message says). So you might want to look at setting that up to the same as the windows config.
    Brenton Alker
    PHP Developer - Brisbane, Australia

    blog.tekerson.com | twitter.com/tekerson | brenton.mp

+ Reply to Thread

Similar Threads

  1. Zend_Filter_StripTags ignoring my allowed items
    By Jhorra in forum Core Infrastructure
    Replies: 1
    Last Post: 03-28-2010, 09:30 AM
  2. Fatal Error Search Lucene Memory Size
    By mberding in forum Mail, Formats & Search
    Replies: 1
    Last Post: 11-13-2009, 03:01 PM
  3. How to get folder size
    By Manoj in forum General Q&A on Zend Framework
    Replies: 0
    Last Post: 06-03-2009, 07:37 AM
  4. Fatal error: Allowed memory size
    By amr.abugwella in forum Core Infrastructure
    Replies: 0
    Last Post: 01-28-2009, 12:58 PM
  5. forward action = memory exhausted
    By arodrpin in forum Model-View-Controller (MVC)
    Replies: 0
    Last Post: 05-22-2007, 08:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts