Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-21-2008, 08:04 AM
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?)?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 11-24-2008, 01:15 AM
Member
 
Join Date: Jul 2008
Posts: 60
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
Brisbane, Australia

http://blog.tekerson.com/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 01:45 AM.