- Issue created by @AppLEaDaY
- ๐ฌ๐งUnited Kingdom longwave UK
The error message suggests the memory_limit setting in php.ini is 256Mb. You should increase this to a more appropriate setting for your server and the size of files you wish to upload.
- ๐ฎ๐นItaly AppLEaDaY
@longwave, thanks... though with a phpinfo() I see the value for memory_limit is 1024M. Besides the problem is not strictly related to the size of the file. I could successfully upload a file larger than 400 MB and I couldn't with smaller files. In general the upload goes however OK with files slightly below 200 MB in size.
- Status changed to Postponed: needs info
over 1 year ago 10:08pm 27 April 2023 - ๐ฌ๐งUnited Kingdom longwave UK
Have you tried setting a higher memory_limit? "Out of memory" is just that, and there is nothing that Drupal can do about it; this is a PHP configuration issue.
- ๐ฎ๐นItaly AppLEaDaY
Premise: I notice when I comment the priority of the issue is reverted back to "critical", but that's not me, that's something automatic.
@longwave, not phpinfo says memory_limit is 2048M, twice the previous value, but the problem is still there.
: Out of memory (allocated 14680064) (tried to allocate 224396424 bytes) in on line
Something about the file follows - coming from "ls -l").
-rw-rw-r-- 1 andrea andrea 224396398 mar 25 00:24 video.mp4
Did you see perhaps anything strange in the numbers?
Please notice the update I made in my post. Mysteriously - for now - I could repeatedly upload one particular file that is more than 400 MB in size. This is puzzling, isn't it?
Thanks in advance!
Andrea
Thanks in advance!
Andrea
- ๐ฎ๐นItaly AppLEaDaY
--- UPDATE ---
I've just set up a local instance of the website on the PC I'm using.In php.ini I didn't change the following setting I found there.
memory_limit = 128M
Result: I have no problems in uploading big files.
So where does that "out of memory" come from on the shared hosting environment?
Thanks in advance!
Andrea
- ๐บ๐ธUnited States cilefen
This is documented in https://www.drupal.org/docs/7/managing-site-performance-and-scalability/... โ
This is a PHP configuration issue, not Drupal.
- ๐ฎ๐นItaly AppLEaDaY
@cilefen, as far as I could see it's a matter of upload_max_filesize, post_max_size and memory_limit, but shouldn't I trust what a phpinfo displays for their values? I'm pretty sure the values I've set for those parameters are enough for the uploads I've in mind.
The "out of memory" occurs at line 76 of core/lib/Drupal/Core/File/FileSystem.php.
Here's what is at line 76...
$result = @move_uploaded_file($filename, $uri);
I took my time to copy from the web and paste some html and some php code to upload a file with a POST request.
Curiously enough with that code I could successfully upload a file I could not upload with the Drupal form.
And that code contains the functionmove_uploaded_file
.This is puzzling to me. I don't mean to argue about any responsibility of Drupal. I kept on writing because I hope to get some idea from knowledgeable people.
Thanks!
- ๐บ๐ธUnited States cilefen
Does ๐ Uploading larger file than the memory limit fails Needs work fix this?
- Status changed to Closed: outdated
10 months ago 10:27pm 20 November 2023 - ๐บ๐ธUnited States cilefen
I am closing this issue due to inactivity. Reopen it as necessary.