|
|||
|
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; 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');
...
}
}
Code:
<form action="" method="post"> <table> <tr> <td>Item title:</td> <td><?php echo stripslashes($this->form->title); ?></td> </tr> ... </table> </form> |
|
|||
|
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. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|