I'm working on a 2.8 symfony project and I can't solve a problem I've been dealing with for a few weeks.
Every form I'm trying to create gets me a "Allowed memory size exhausted" error. This should be a configuration problem because my project is working on dev and prod environments, and on other computers. It's just not working on mine.
Error exemple : OutOfMemoryException in BundleEntryReader.php line 134:
Error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 134217736 bytes)
I'm working on Ubuntu. I tried remove and re-install both apache and php (7.1), but no success. I also tried to allow more memory and execution time, but my scripts keep running for dozens of minutes.
$projectForm = $this->createForm(
new ProjectType($choices, $user->getCompany()),
$project,
['action' => $this->generateUrl('company_project_create',['projectId' => $project->getId() ])]
);
I'd like to be able to generate a form. the problem is in the form generation. In every script I use, evrything is ok until the "$this->createForm()" function. Let's says that this application runs on computers with less ram.
/*****EDIT*****/
I found that the problem came from two types in my ProjectType : user and address :
$builder
->add('user', UserType::class, [
'label' => 'customer.user.label',
])
->add('address', ProjectAddressType::class, [
'label' => 'customer.project.address.label',
])
Here is for example where my userType has problem :
public function buildForm(FormBuilderInterface $builder, array $options)
{
parent::buildForm($builder, $options);
$builder
->add('photo', HiddenType::class, ['required' => false])
->add('isSendDailyMail', CheckboxType::class, [
'label' => false,
'required' => false,
]);
}