Labels |
Added:
No Code Attached Yet
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-08-27 02:42:50 |
Closed_By | ⇒ | jwaisner |
Closed_Date | 2021-08-27 02:42:50 | ⇒ | 2021-08-27 02:42:51 |
Closed_By | jwaisner | ⇒ | joomla-cms-bot |
Thank you @djayko for reporting this. Based on the information provided, this is not a Joomla issue but a hosting issue. Please work with your hosting provider to resolve.
Set to "closed" on behalf of @jwaisner by The JTracker Application at issues.joomla.org/joomla-cms/35360
Not a Joomla issue. This is a hosting issue.
I know, but joomla doesn't work as expected with setup of memory_limit = -1
If you override your default webhost settings with sensible sane defaults then it will work, as you have found out.
I found it out, but only accidently. Maybe a recommendation during joomla setup would help if it's not an joomla issue.
Also note that
memory_limit
has no bearing on the ability to upload files. This is a memory limit that PHP can consume when running.
I know and that's the reason for reporting this issue. It doesn't make sense getting and error message "This file is too large to upload." if memory_limit is set to -1
delete ALL php.ini and .user.ini files throughout your webspace and use your web hosts (hopefully sane) defaults.
I did it already. web host default is memory_limt = - 1
Result: I can't upload images and get error message "This file is too large to upload."
Also you should NEVER need to override and set a PHP Session save path (as I see you mention in your forum post) if you do - then your webhost is pathetic and incorrectly configured.
It was the right way for figuring out what could be wrong or help and also there are
Normally, I don't use that overrides. And joomla 3.10 is working well without any overrides.
But it was helpful figuring some points for reporting.
Summary:
Media Manager is showing error "This file is too large to upload." on standard server setup from my host with memory_limit = -1 (for no limit)
on Joomla 3.10. its working well on same server with same settings.
ok let me say this again.
"Also note that memory_limit has no bearing on the ability to upload files. This is a memory limit that PHP can consume when running."
ok let me say this again.
"Also note that memory_limit has no bearing on the ability to upload files. This is a memory limit that PHP can consume when running."
And let me state again, I know that memory_limit is an hoster issue.
But this behaviour and the error emssage as well is not expected and not comprehensible for me as well.
And that's reason why I reported this. Because this behaviour is strange regarding no upload is happening and error message is "This file is too large to upload."
Thats a topic for joomla.
One assumption, the error message is wrong. And why does it occur in the dependency of memory_limit?
Next assumption, memory_limit=-1 is not handled correctly by joomla or maybe it needs at least and infromation towards user to check server configuration (maybe during installation or upgrade), so that the user is able setting up the correct settings with his host.
additional information:
just for your information. memory_limit is an issue withing the code for uploading a file.
As you can see, there is a comparison between filesize and memory_limit and this causing the error due to the fact that server standard is set to "memory_limit=-1"
|| $serverlength > $helper->toBytes(ini_get('memory_limit'))
if 1kb > -1 then error message
file:
root/administrator/components/com_media/src/Controller/ApiController.php
line 360:
private function checkContent()
{
$params = ComponentHelper::getParams('com_media');
$helper = new MediaHelper;
$serverlength = $this->input->server->getInt('CONTENT_LENGTH');
if (($params->get('upload_maxsize', 0) > 0 && $serverlength > ($params->get('upload_maxsize', 0) * 1024 * 1024))
|| $serverlength > $helper->toBytes(ini_get('upload_max_filesize'))
|| $serverlength > $helper->toBytes(ini_get('post_max_size'))
|| $serverlength > $helper->toBytes(ini_get('memory_limit')))
{
throw new \Exception(Text::_('COM_MEDIA_ERROR_WARNFILETOOLARGE'), 403);
}
}
maybe this helps for a better understanding and finding a solution.
best regards,
Ayko
No idea what @laoneo was thinking by adding that, because it makes no sense. At no time is PHP trying to load the full content of the request into PHP Memory and therefore memory_limit
, as I have repeatedly said, is nothing to do with PHP file uploads.
I'll PR to remove this check.
Also dont take my word for it - read what others state:
as I have repeatedly said, is nothing to do with PHP file uploads.
Of course. In general I'm completely with you.
I'll PR to remove this check.
Thanks.
@PhilETaylor If you would do a proper check then you would see that this code was added 9 years ago 627e9c4 and not as part of the new media manager. If you fix it in 4 then you probably want to fix it also in 3.
Same - This file is too large to upload - issue confirmed on all of our servers.
The uploads work well with the latest J! 3.x; doesn't work on 4.x. on the exact same environments. No matter if PHP 7.4.x or 8.x is used.
Not with memory_limit modifications nor php.ini/user.ini deletion or .htaccess modification, or anything else we tried.
The only solution was to modify the lines within administrator/components/com_media/src/ControllerApiController.php
Thanks again @djayko .
@PhilETaylor - no comment.
Happy to send any debug or other information if requested.
The only solution was to modify the lines within administrator/components/com_media/src/ControllerApiController.php
What exactly did you modify ?
Not a Joomla issue. This is a hosting issue.
If you override your default webhost settings with sensible sane defaults then it will work, as you have found out.
Also note that
memory_limit
has no bearing on the ability to upload files. This is a memory limit that PHP can consume when running.delete ALL php.ini and .user.ini files throughout your webspace and use your web hosts (hopefully sane) defaults.
Also you should NEVER need to override and set a PHP Session save path (as I see you mention in your forum post) if you do - then your webhost is pathetic and incorrectly configured.