unable to add any file > 128 kB (yes kilobytes) to the Media Library if Apache webserver
error message : “The server cannot process the image. This can happen if the server is busy or does not have enough resources to complete the task. Uploading a smaller image may help. Suggested maximum size is 2560 pixels.”
What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc
-install current localWP Version 8.1.0+6514.
-leave all settings as default, except webserver : Apache (not nginx).
-Fresh WP site (6.4.2) and default theme Twenty Twenty-Four.
-Go to Media. Add new media file. Select any file > 128 kB.
More interesting is the Apache Site-error.log : “[Fri Dec 08 19:47:25.333337 2023] [fcgid:warn] [pid 10116:tid 1348] [client 127.0.0.1:23913] mod_fcgid: HTTP request length 134975 (so far) exceeds MaxRequestLen (131072), referer: http://test128k.local/wp-admin/upload.php”
It shows the size limit of 128 kB being exceeded.
Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.
Just as a test if you switch to NGINX are you seeing any errors or does it work there?
Can you share your full local log? There are some different ways to access and share Local Logs. For us to be able to troubleshoot thoroughly, please click the Download Local Logs button from the Support tab in Local. This will generate a zip archive that contains the Local log along with some other diagnostic information to help quickly zero in on any issues that Local is encountering.
I did some further investigation and found a bypass to the problem.
I edited the C:\Users\xxxxxxx\Local Sites\mywebsite\conf\apache\modules.conf.hbs and added the following at the bottom of the file :
Now I can add files with sizes up to 128 MB (Megabytes) in the Media Library !
It should be nice that this update be standard in a next localWP release.
You’re right that the FcgidMaxRequestLen property would fix the issue. We actually did add that config last year, but my guess is you downloaded Apache before we added that fix, so your version in Local might be outdated. Here’s how you can make sure you’re on the latest version of Apache:
Check Your Current Apache Version:
Go to Help -> Reveal Local's Logs in Local.
In the logs folder, navigate to the lightning-services directory.
Look for a folder named like apache-2.4.43+X. Please note down the version string and build number.
Manually Update Apache:
Stop your sites and close Local.
Delete the apache-2.4.43+X folder you found. This will remove the outdated Apache service from your machine.
Redownload and Update Apache:
Reopen Local.
Start your site as usual. This action will trigger an automatic redownload of the latest Apache files from our Content Delivery Network (CDN).
Verify the Update:
After the service redownloads, check the Apache directory again. The new folder should have a newer +X build number.
Confirm that the FcgidMaxRequestLen configuration block is now present at the bottom of the Apache config file.
Unfortunately, Local currently doesn’t have a feature to automatically update web server service files (like the *.conf.hbs files) when the actual version of Apache stays the same. Our in-place update functionality is limited to PHP only at the moment, but I’ll note that we should be extending that feature to all of our services!
Thank you for the reply and the clear explanation.
I applied the suggested steps to upgrade Apache :
version string and build number : apache-2.4.43+7.
OK.
OK.
version string and build number : apache-2.4.43+8. I confirm that the FcgidMaxRequestLen configuration block is now present at the bottom of the Apache config file. I see that FcgidMaxRequestLen is now 30000000 (30 MB). I updated FcgidMaxRequestLen to 300000000 (300 MB) allowing up to 300 MB file-sizes additions in the Media Library.