Skip to content

Tutorials cPanel Beginner1 min read

How to Increase the PHP Upload Limit

Raise upload_max_filesize, post_max_size and memory_limit in cPanel, php.ini, .user.ini or .htaccess so large uploads and imports work.

By ZSOLNET Editorial Team Updated

Key takeaways

  • upload_max_filesize caps one file; post_max_size caps the whole request.
  • post_max_size must be larger than upload_max_filesize.
  • cPanel's MultiPHP INI Editor is the safest way to change limits on shared hosting.

When an upload fails with “The uploaded file exceeds the upload_max_filesize directive” or a database import stops halfway, PHP’s limits are too low for the job.

The settings that matter

  • upload_max_filesize — the largest single file PHP accepts.
  • post_max_size — the largest whole request. Keep it a little above upload_max_filesize.
  • memory_limit — memory one script may use. Large imports often need more.
  • max_execution_time — seconds a script may run before it’s stopped.
  1. In cPanel, open Software → MultiPHP INI Editor.
  2. On the Basic Mode tab, select your domain.
  3. Set, for example, upload_max_filesize to 64M, post_max_size to 72M, memory_limit to 256M.
  4. Click Apply. Changes take effect immediately.

Option 2: .user.ini

Create or edit .user.ini in the site’s document root:

upload_max_filesize = 64M
post_max_size = 72M
memory_limit = 256M
max_execution_time = 120

PHP rereads this file every few minutes (5 by default), so wait briefly before testing.

Option 3: php.ini on a VPS

Find the active file with php --ini (for the web server, check the PHP-FPM version’s php.ini), change the values, and restart PHP-FPM, for example sudo systemctl restart php8.3-fpm.

Frequently asked questions

How do I check my current limits?

In WordPress, open Tools → Site Health → Info → Server. Anywhere else, create a temporary phpinfo() file, read the values, then delete the file.

Should I edit .htaccess or php.ini?

Use whatever your host supports. With PHP-FPM (most modern hosting), php_value lines in .htaccess cause a 500 error — use .user.ini or the cPanel editor instead.

Share X LinkedIn Facebook

Log in to your account

Manage your domains, hosting and invoices in one place.

Secure connection straight to the ZSOLNET client area.

No account yet?