Getting error in uploading videos to WordPress
Closed this issue · 3 comments
CloudPanel version(s) affected
2.4.2
Description
I am trying to upload a 250 MB video file on WordPress on CloudPanel, but it is not letting me do it. I have tried 70 MB and 150 MB video as well but it is not working too. I test the same videos on other servers (LiteSpeed cPanel, Apache cPanel, Nginx Hestia) and the videos get uploaded to all other servers.
PHP max input variables 10000
PHP time limit 10000
PHP memory limit 10000M
Max input time 10000
Upload max filesize 10000M
PHP post max size 10000M
WP_MEMORY_LIMIT 10000M
WP_MAX_MEMORY_LIMIT 10000M
I have added this code in the VHost code as well:
client_max_body_size 10000M;
How to reproduce
Upload videos with 50 MB or more size.
Possible Solution
No response
Additional Context
No response
If you need testing login details or videos then I can provide.
You can check the Nginx access log and the application logs. It's not really a CloudPanel bug.
Yes, it was due to CloudPanel. The same was working on Hestia with Nginx without any additional configuration.
I added the below Vhost file and it is working now.
`server {
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /path/to/your/fullchain.pem;
ssl_certificate_key /path/to/your/privkey.pem;
server_name www.example.com;
return 301 https://example.com$request_uri;
}
server {
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /path/to/your/fullchain.pem;
ssl_certificate_key /path/to/your/privkey.pem;
server_name example.com www.example.com;
root /var/www/example.com/public_html;
access_log /var/log/nginx/example.com-access.log;
error_log /var/log/nginx/example.com-error.log;
# Global settings for large file uploads
client_max_body_size 10000M;
client_body_timeout 3600s;
client_header_timeout 3600s;
keepalive_timeout 3600s;
send_timeout 3600s;
client_body_buffer_size 128k;
if ($scheme != "https") {
rewrite ^ https://$host$uri permanent;
}
location ~ /.well-known {
auth_basic off;
allow all;
}
location ~/\.git {
deny all;
}
location ~/(wp-admin/|wp-login.php) {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8080;
proxy_max_temp_file_size 0;
proxy_connect_timeout 3600;
proxy_send_timeout 3600;
proxy_read_timeout 3600;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
}
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_hide_header X-Varnish;
proxy_redirect off;
proxy_max_temp_file_size 0;
proxy_connect_timeout 3600;
proxy_send_timeout 3600;
proxy_read_timeout 3600;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
}
location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf|map)$ {
add_header Access-Control-Allow-Origin "*";
expires max;
access_log off;
}
}
server {
listen 8080;
listen [::]:8080;
server_name example.com www.example.com;
root /var/www/example.com/public_html;
try_files $uri $uri/ /index.php?$args;
index index.php index.html;
# Global settings for large file uploads
client_max_body_size 10000M;
client_body_timeout 3600s;
client_header_timeout 3600s;
keepalive_timeout 3600s;
send_timeout 3600s;
location ~ \.php$ {
include fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
try_files $uri =404;
fastcgi_param HTTPS "on";
fastcgi_param SERVER_PORT 443;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
# FastCGI timeout settings for large file uploads
fastcgi_read_timeout 3600;
fastcgi_send_timeout 3600;
fastcgi_connect_timeout 3600;
}
}`