0

enter image description here

i'm working on making crud with symfony and php the READ and DELETE working fine but when i add the create witch is a very simple code :

#[Route('/addClassroom', name: 'addClassroom')]
    public function addClassroom(ManagerRegistry $doctrine,Request $request)
    {
       
        $classroom = new Classroom();
        $form = $this->createForm(ClassroomFormType::class,$classroom);
        $form->handleRequest($request);
        if($form->isSubmitted()){
            $em =$doctrine->getManager();
            $em->persist($classroom);
            $em->flush();
            return $this->redirectToRoute('afficheC');
        }

        return $this->renderForm('classroom/addClassroom.html.twig',array('f'=>$form));

    }

that erreur shows up : normally it's a thing related with uac(deactivated it so Xampp can run freely) or tls (tried commenting the openssl on both php.ini)currently i'm on 8.1.6 version for both Xampp and php , tried other version but same problem .

btw i did the database work from terminal like so : 1- symfony console doctrine:database:create 2- symfony console make:entity 3- symfony console make:migration 4- symfony console doctrine:migration:migrate 5- symfony console make:form ClassroomForm

1 Answers1

0

I had this error, in a similar context, i solved it by changing the authorization of the /tmp/ file, allowing writing and modification for user.

  • can you tell me more how to do it – Abdo Bodabous Nov 09 '22 at 20:15
  • @AbdoBodabous Using window 10. right click on your /tmp/ file (the one mentioned on the error, here D:\XAMP\tmp, mine was C:\laragon\tmp) Property > Security Tabs will give you access to the authorization panel. Because it's a very general modification, i advise you to search for "how to modify files permission on [operating system]" – SloppyDisk Nov 12 '22 at 16:41