Search code examples
phpfilesymfonynotice

Notice warning from PHP in Symfony uploading file


I have a form that allows upload three files at the same time but just one is required. That works fine, my only problem is the following: if I upload three files I haven't any problem but if I upload one or two files (leaving two or one files empties) I obtain the following notice:

Notice: No file uploaded in Unknown on line 0

As much as empty files. The files are uploaded properly without any other problem, but I want remove that notice... or unless hide it, although I prefer remove it. I tried to hide it using

error_reporting(0);

and

ini_set('display_errors',0);

but neither of two worked...

It is the first time that I have problem, if someone could lead me I'd be very grateful due to that I am stuck with it.


Solution

  • If you are having the same problem as me, check with phpinfo() if you are using a debug version of PHP. If you see that Debug Build has a value of yes, your problem will be fixed if you install a live version of PHP instead of a debug version