Applicable to:
- Plesk for Linux
Symptoms
-
When using PHP as FastCGI, if you try to upload a large file, the below error occurs and causes
550 internal server error
or502 Bad Gateway.
-
If nginx support is enabled, Apache
/var/www/vhosts/system/example.com/logs/error_log
contains the following error:mod_fcgid: HTTP request length ... (so far) exceeds MaxRequestLen (1310720)
-
Nginx
/var/www/vhosts/system/example.com/logs/proxy_error_log
contains the error below:upstream prematurely closed connection while reading response header from upstream
Cause
The [FcgidMaxRequestLen](https://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html#fcgidmaxrequestlen)
and/or FcgidMaxRequestInMem
directives are not large enough.
Resolution
Click on a section to expand
This only works with FPM application served by Apache, otherwise use custom templates
-
Connect to the server via SSH.
Note: if direct SSH access to the server is not possible, contact server administrator for further assistance.
-
Edit
fcgid.conf
file which is located in/etc/httpd/conf.d/
(for RHEL based OS) or/etc/apache2/mods-available/
(for Debian based OS). -
Set
FcgidMaxRequestLen
andFcgidMaxRequestInMem
with the same values in bytes. For example, 1024 MB corresponds to 1073741824 B. -
Restart Apache:
For RHEL based OS
# service httpd restart
For Debian based OS:
# service apache2 restart
:::
Click on a section to expand
-
Log into Plesk
-
Go to Domains > example.com > Apache & Nginx settings > Additional directives for HTTP & HTTPS
<IfModule mod_fcgid.c>
FcgidMaxRequestLen 1073741824
FcgidMaxRequestsPerProcess 100
FcgidProcessLifeTime 7200
FcgidIOTimeout 7200
FcgidMaxRequestInMem 1073741824
</IfModule>
Comments
0 comments
Please sign in to leave a comment.