Developer tool

PHP Upload Limit Calculator

Calculate coherent upload_max_filesize, post_max_size, and related layers for Apache/Nginx + PHP.

How it works

What it does

The Upload Limit Calculator helps you choose consistent values across PHP’s upload_max_filesize, post_max_size, max_file_uploads, and related constraints, while calling out web server body-size limits that often sit in front of PHP.

When to use it

  • Users report “empty POST” after large form uploads
  • You raised one PHP directive but uploads still fail at 1MB or 8MB
  • Planning media upload policies for WordPress or custom apps

How input is processed safely

You enter sizes and options; the tool returns calculations and ASCII layer notes. It never uploads your files, never connects to your server, and never changes live configuration. Units like K/M/G are parsed as text math only.

Examples

  • Target 64M file uploads → ensure post_max_size is larger than upload_max_filesize
  • Show why Nginx client_max_body_size can reject the request before PHP runs
  • Explain multi-file forms hitting max_file_uploads

Common mistakes

  • Setting upload_max_filesize above post_max_size
  • Forgetting reverse-proxy limits in front of the origin
  • Assuming .htaccess php_value works under PHP-FPM the same as mod_php

Upload failures are layered. Browsers impose practical limits, CDNs and proxies impose body limits, web servers impose body limits, and PHP imposes post_max_size, upload_max_filesize, and max_file_uploads. If any layer is smaller, users see generic failures that look like application bugs.

When post_max_size is exceeded, PHP may present empty $_POST/$_FILES arrays with little explanation. That is why the calculator emphasizes ordering and headroom between post and upload sizes, plus notes for Apache and Nginx knobs you must set separately.

For multi-file forms, count fields and average sizes, not only the largest single file. A gallery uploader can pass single-file limits and still fail on upload count or total post size.

Practical tips

  • Keep inputs small and representative; huge pastes slow feedback and raise risk of accidental secret disclosure.
  • After using PHP Upload Limit Calculator, verify the result in your own environment (correct SAPI, correct host, correct project root).
  • Cross-link findings to ZendStudio.net PHP error guides and IDE setup pages when the next step is configuration rather than code edits.
  • Prefer repeatable project tooling (CI, Composer scripts, IDE inspections) for repo-wide enforcement; this page is for interactive problem-solving.

Privacy note

No file content is required—only numeric limits. Do not paste credentials from hosting panels into the form fields.

Run in browser

AJAX processing only. No remote PHP execution sandbox. Results are not indexed.

Inputs are processed for this request only and are not stored in analytics. Object unserialize and arbitrary PHP execution are blocked.

Safety notes

  • Submitted tool contents are not written to analytics or search logs.
  • This site never evaluates arbitrary PHP from the browser.
  • Generated configs are starting points—validate on a staging host before production.