Skip to content

Website & Server Help

Menu
  • Home
  • Website
    • WordPress
    • 22 Ways To Speed-Up A Plesk Website
  • Server
    • How To Install a Let’s Encrypt SSL in Apache on Debian/Ubuntu
    • Installing Remote Desktop on Debian 12
    • Installing Remote Desktop on Ubuntu 22.04
    • MongoDB 6 with NodeJS 18 on Debian 11
    • Installing MongoDB 6 with NodeJS 18 on Ubuntu 22.04
  • Favs
    • Checking File System and Hard Drive Health
    • Running tests for a slow server or dropped packets
Menu

How to increase Upload Max Filesize

Posted on January 18, 2023January 27, 2023 by admin

Are you having issues uploading large files? Do you receive an error about exceeding a maximum upload file size? Are you trying to increase the upload max filesize for a WordPress website, or PHP website?

The best way to increase the PHP Upload Max Filesize is by creating or editing a PHP.ini file in the directory. This may include the root directory of the website, as well as /wp-admin, or others depending on your website’s configuration.

  1. Create or edit php.ini file inside of applicable directories.
  2. Add the following lines:
    upload_max_filesize=128M;
    post_max_size=130M;
    memory_limit=256M;
    max_execution_time=300;
    max_input_time=300;

upload_max_filesize is the maximum size of file you want to allow to be uploaded on your website (through scripts/forms, this does not affect FTP uploads).
post_max_size will include other data about the file transfer and server-client communication, so should always be larger than upload_max_filesize.
memory_limit should be larger than post_max_size.
max_execution_time and max_input_time are in seconds, and indicated how long a script/process can run (ie, uploading script).

Note: If you also plan on uploading a lot of files at once, it may be required to also specify or increase the max_input_vars:

max_input_vars=1000;

Cloud Server
1 vCore, 1 GB RAM, 40 GB SSD
Unlimited Bandwidth
$5/month
First month free
!