
Upload size is controlled at two independent layers: Nginx and PHP. Nginx has a default client_max_body_size of 1MB. PHP has upload_max_filesize (default 2MB) and post_max_size (default 8MB). Both layers enforce their own limit independently — you must increase both, and Nginx must be set at least as high as PHP.
The typical symptom is a 413 Request Entity Too Large error from Nginx when the file exceeds client_max_body_size. If Nginx passes the request but PHP rejects it, WordPress shows a vague "HTTP error" — this usually means PHP's upload_max_filesize limit was hit.
Add client_max_body_size to your server block. Setting it in the server block applies it to all locations in that block. You can also set it per-location if only specific endpoints (like an upload handler) need a higher limit.
PHP enforces two upload-related limits: upload_max_filesize caps a single file, while post_max_size caps the entire POST request body including all files and form fields combined. Set post_max_size slightly higher than upload_max_filesize to account for the form data overhead.
PHP-FPM reads php.ini at startup, not on each request. After editing php.ini you must restart or reload PHP-FPM for the changes to take effect. Nginx also needs a reload after you change client_max_body_size.
Setting upload limits very high (500MB+) can expose your server to memory exhaustion if many large uploads arrive simultaneously. Each upload holds the file in PHP memory until processing completes. For high-traffic sites, consider handling large uploads with a dedicated upload service or object storage rather than through PHP directly.
WordPress reads PHP's upload limit and displays it in Media Settings as the "Maximum upload file size". After updating PHP-FPM settings, navigate to Settings → Media in your WordPress admin to confirm the new limit is shown. If it still shows the old limit, PHP-FPM did not reload correctly — check with systemctl status php8.3-fpm.
CloudStick manages PHP configuration through its EasyPHP interface — you can set PHP memory limit, upload size, and execution time for each website independently without editing configuration files manually. Changes apply immediately on save, and CloudStick reloads PHP-FPM automatically.
The easiest way to test is to create a test file of your target upload size and attempt to upload it through WordPress Media → Add New. You can also use curl to POST a file directly to confirm Nginx accepts it. A 413 response means Nginx's limit is still too low; a PHP-reported error means the PHP limit is too low.


We use cookies to improve your experience
CloudStick uses cookies to personalise content, analyse traffic and keep you signed in. Cookie Policy · Terms of Service