View Single Post
  #1 (permalink)  
Old 11-21-2008, 08:04 AM
meph 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?)?
Reply With Quote