I noticed that my site is now running PHP 8.2.11 and also noticed this
PHP max_file_size is 20MB
should this be limited to 10MB ? or am I misunderstanding something here
I noticed that my site is now running PHP 8.2.11 and also noticed this
PHP max_file_size is 20MB
should this be limited to 10MB ? or am I misunderstanding something here
There are 2 settings:
One in php.ini and one in Apache (httpd.conf)
The Apache config overrides the PHP setting.
so does this mean that php will allow a file of 20MB to be uploaded just for server to then delete it ?
Yeah, php tries to upload the file and then gives an error about Apache file size being set lower. The upload will fail.
would it not be better to configure this php value to 10MB instead of 20MB ?
It’s probably the default setting for PHP.
You have to do error handling in php on file uploads. I like to do client side file size checks with Javascript to avoid wasting resources.
it may possibly be the default, I think it would be better for the server if this was changed to 10MB
I agree
Not every uploaded file gets put on disk as-is. With these increased limits, you could upload a 16 MB ZIP file, extract it with PHP and write the extracted files to disk. This is especially useful for things like script/theme/plugin installations.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.