Solved On Wordpress installs the file upload errors out to "An error occurred in the upload. Please try again later."

AutiCodes

Verified User
Joined
Jun 9, 2024
Messages
39
Hi, so on all my Wordpress installations i can't upload most of the files i wanna upload.
This is system wide. All since the beginning of the fresh DA install.
The error is: "An error occurred in the upload. Please try again later.". Debug logs didn't say anything usefull on the error.

First, some info!
Wordpress:
- File upload max size: 1G
- Directory permissions: all writable
- PHP 8.2
- Wordpress 6.6.1

DirectAdmin
- Version: 1.660

OS:
Ubuntu 22.04 LTS

I've no idea where i can look now. Tried a lot but it didn't help.
Who have experience with this?
 
Are they bigger than 1G? And did you check the max upload size of php? Because that is often limited to 64M.
Nope, it does error out when the file upload has succeeded (tested it).
The files are well within the file upload limit
 
Is it a 403 error (in apache logs)? If so, and if you have it active, check the mod_security logs.......

Uploading shouldn't trigger mod_security but
 
So some can and some can't. I would compare what's the difference between the possible ones and not possible ones. File extensions, how big they are and such.
Could indeed also be cause by mod_security, Immunify360 or something similar.

Also something to test is to disable all WP plugins and see how it behaves then.
And if the account has enough disk space quota.

Edit: Just seen your mysql issue. Could also be related.
 
Hi
Is it a 403 error (in apache logs)? If so, and if you have it active, check the mod_security logs.......

Uploading shouldn't trigger mod_security but
So some can and some can't. I would compare what's the difference between the possible ones and not possible ones. File extensions, how big they are and such.
Could indeed also be cause by mod_security, Immunify360 or something similar.

Also something to test is to disable all WP plugins and see how it behaves then.
And if the account has enough disk space quota.

Edit: Just seen your mysql issue. Could also be related.
Hi y'all,
so i think i found an good clue. Even when Wordpress says "Maximum upload file size: 1GB.", it cant upload zip files larger then 64MB. So every zip file upload succeeds < 64MB but every zip file > 64MB (like 94MB) fails to upload with an unexpected response from the server.

So i think i need to look there but idk where.

Greets Kelvin
 
Update!
So i've manual changed in "/usr/local/php82/lib/php.ini" the values:
- upload_max_filesize
- post_max_size
to 1G.

Now it works! I can upload the files there errored out with that weird error. No idea why the GUI didn't work but o well, it's fixed for now :)
(oh also turned Modsec off for those domains)
 
Last edited:
So i've manual changed in "/usr/local/php82/lib/php.ini" the values:
So that's exactly where I pointed at in my first reply. :)
But indeed it's also the post_max_size.

I don't work the the GUI for setting limits so no idea as to why setting a higher value there won't work.
 
".user.ini" is your choice.

My app always put backword compatibility ( .htaccess ) and new ways to handle directive value ( .user.ini ).
 
Back
Top