Skip to main content

How to Increase the PHP File Upload Limit for One Website

You can increase the maximum file size allowed for uploads on a specific website by modifying the PHP configuration. This allows you to upload larger files, such as high-resolution images or large installers, to your website.

You can increase the maximum file size allowed for uploads on a specific website by modifying the PHP configuration. This allows you to upload larger files, such as high-resolution images or large installers, to your website.

Before you begin

You will need:

  • A Hostek account with access to the hosting control panel.

  • The specific website's management interface (such as cPanel or Windows Control Panel).

  • The current file path or name of the script you are using to perform the upload.

Adjusting the PHP upload limit

The method for changing this limit depends on the operating system of your hosting environment.

For Linux-based servers (cPanel)

  1. Log in to your hosting control panel.

  2. Locate and open the Select PHP Version or MultiPHP INI Editor tool.

  3. Select the specific domain or account you wish to modify.

  4. Locate the upload_max_filesize directive.

  5. Change the value to your desired limit (e.g., 64M, 128M, or 256M).

  6. Locate the post_max_size directive.

  7. Set the post_max_size to a value equal to or slightly larger than the upload_max_filesize value.

  8. Click Save or Apply.

For Windows-based servers (Windows Control Panel)

  1. Log in to the Windows Control Panel.

  2. Navigate to the PHP Settings section for the specific website.

  3. Locate the upload_max_filesize setting.

  4. Enter your desired limit (e.g., 128M).

  5. Locate the post_max_size setting.

  6. Enter a value equal to or larger than the upload_max_filesize.

  7. Click Save.

Confirm the result

To verify that the change has taken effect, you can use a PHP information page or a script to check the current limits.

  • Navigate to your website's information page (e.g., example.com/info.php).

  • Locate the upload_max_filesize and post_max_size lines.

  • Confirm that the values match the limits you entered in the control panel.

Limitations

  • The post_max_size must always be greater than or equal to the upload_max_filesize. If post_max_size is smaller than upload_max_filesize, the upload will fail for any file exceeding the post_max_size limit.

  • Some web applications or CMS platforms (like WordPress) may have their own internal limits that can override the server's PHP settings. If the limit does not change in your application, check your application's specific configuration files.

Did this answer your question?