Reputation: 1
in a project created with symfony 4.4.* when uploading files i got the following error
Warning: POST Content-Length of 12406038 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
I can fix this by changing the upload_max_filesize and post_max_size with the function ini_set()
my question is where to put it:
or in the specific method of the controller ?
Upvotes: -3
Views: 907
Reputation: 4551
The best solution (a fact-based answer) is to set it in php.ini
file to avoid any performance issue. And here is a useful chapter about configuration of ini variables.
But you cannot update these two parameters by using ini_set
. Both of those options have the changeable mode of PHP_INI_PERDIR
as CBroe mentionned it in his comment.
For other parameters, if you cannot update your php.ini, this question is likely to be answered with opinions rather than facts and citations. Depending on your web server, you can do it:
.php.ini
file at the top directory of your project,.ht_access
in the public directory,Upvotes: 0