Error "Failed to start the session: already started by PHP."


#1

Hi,
I am getting error message “Failed to start the session: already started by PHP.” in Admin mode when I try to edit or preview a document.

When published, The page renders and functions fine Online.

the debug logs show:
Uncaught PHP Exception RuntimeException: “Failed to start the session: already started by PHP.” at C:\wamp64\www\xxx\vendor\symfony\symfony\src\Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage.php line 136

The document consist of a form
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add(‘customer’, CustomerType::class,[
‘label’ => ‘Customer’,
‘required’ => false,
‘placeholder’ => ‘Select a Customer’
])
->add(‘product’,ProductType::class, [
‘label’ => ‘Product’,
‘required’ => false,
‘placeholder’ => ‘Select Product
])
->add(’_submit’, SubmitType::class, [
‘label’ => ‘Submit’
]);

}

Wonder what is going on ?
Thanks,
Ritu


#2

error is thrown when executing the line

$this->view->form = $form->createView();