upload_max_filesize is stuck at 2M although I have set in the correct php.ini file to 50M [closed]

  csv, database, php, symfony

I have to read data from multiple csv files.

I therefore retrieve the data via a form linked to my entity.

My files are 90Ko, 6Mo and 17Mo.

Yes, I have correctly set the PHP.INI file, my settings are indeed present when I look in phpinfo () but I still have the limit which is always 2M when i try to upload my csv.

Are there any special settings to make when using symfony’s createFormBuilder?

All I can find in answer is to sort out:

that I have already set extremely high but the limit remains at 2M when I do a dump(ini_get ('upload_max_filesize'));

and of course, I have restart the server

I do not know where to look, knowing that I have looked around the options that I know.


the problem is that I cannot import my data on the database because of the import limit

 $formPalmier = $this->createFormBuilder()
        ->add('formPalmier', FileType::class, [
            'attr' => ['accept' => '.csv'],
            'label' => 'Import Palmier'


        if ($formPalmier->isSubmitted() && $formPalmier->isValid()) {

             * @var UploadedFile
            $file = $formPalmier->get('formPalmier')->getData();  
            if (($handle = fopen($file->getPathname(), "r")) !== false) {

                $count = 0;
                while (($data = fgetcsv($handle, 0, ";")) !== false) {

                if ($count == 1) { continue; }

                $entity = new Palmier();

                $entity->setNumeroAffaire($data[0]);                //string
                $num1 = (int)$data[1];

                $num2 = (int)$data[2];

                $entity->setNatureEtiImportPalmier($data[3]);                //string

                $entity->setPoseDepose($data[4]);                //string

                $date5 = explode("/", $data[5]);                    //transformation en date
                $DateService = '"'.$date5[2].'-'.$date5[1].'-'.$date5[0].'"';
                $DateService = DateTime::createFromFormat('Y-m-d',$DateService);

                $num6 = (int)$data[6];

                $float7 = (float)$data[7];



            return $this->redirectToRoute('import');

Source: Symfony Questions