Adjust upload file size limit for the file manager in Plesk
Preface
The File Manager integrated in Plesk has a default size limit for uploadable files. This limit is 2GB by default. In order to be able to upload larger files via the File Manager, some adjustments must be made in Plesk. In this article, you will learn how to adjust the size limit for uploadable files.
Prerequisites
- Unmanaged server with Plesk Control Panel
If you would like to increase the upload file size limit on your managed server, please contact our support team so that we can make the necessary adjustments. See also: Contact us
Customize PHP settings
The PHP configuration variables upload_max_filesize and post_max_size can be used to configure the maximum file size and the maximum request size. Open the file /usr/local/psa/admin/conf/php.ini with a text editor of your choice and adjust the variables as required. Make sure to specify the values in bytes.
Example (adjustment to 20GB):
nano /usr/local/psa/admin/conf/php.ini post_max_size = 21474836480
upload_max_filesize = 21474836480 Customize the web server configuration of the Plesk Panel
The configuration variable client_max_body_size of the Plesk-specific web server is used to determine the maximum size of a client's request body. Open the file /etc/sw-cp-server/config with a text editor of your choice and adjust the variable according to your requirements.
Example:
nano /etc/sw-cp-server/config worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
' '$http_user_agent' '$http_x_forwarded_for''
"'$fastcgi_script_name' '$fastcgi_path_info' '$document_root'";
sendfile on;
reset_timedout_connection on;
#keepalive_timeout 0;
keepalive_timeout 65;
#tcp_nodelay on;
#gzip on;
#gzip_disable "MSIE [1-6]\.(?!.*SV1)";
server_tokens off;
fastcgi_max_temp_file_size 0;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
fastcgi_pass_header X-Accel-Buffering;
client_max_body_size 2048m; <----------------------------------- Make adjustments here
error_page 497 https://$hostname:$server_port$request_uri;
include /etc/sw-cp-server/conf.d/*.conf;
} Restart the Plesk Panel web server
To apply your changes, the Plesk-specific web server must be restarted. To do this, execute the command systemctl restart psa. Then log out of the Plesk interface and log in again for the changes to take effect. You can then successfully upload files that are larger than the predefined limit.