WebMatrix – How to increase upload limit

The default upload limit in WebMatrix is 2 megabytes.

The upload limit is determined by three factors, the limit being the smallest:

  • memory_limit
  • upload_max_filesize
  • post_max_size

So to increase the upload limit you need to make sure that each of these settings is more than the limit you want to set.

In this example we’ll be changing the limit to 32 megabytes.

Step 1: Check your PHP version

Because we need to modify the PHP settings, we first need to check which version of PHP is being used by your WebMatrix install.

  1. In WebMatrix, click on ‘Site’ in the bottom left of the window
  2. Now click on ‘Settings’
  3. Under ‘PHP Settings’ you will need the version of PHP being used – in this example it is PHP 5.5

Step 2: Locate the PHP.ini file

The PHP.ini file holds all the configuration details for the PHP interpreter.

You will need to locate the copy of PHP.ini based on the version of PHP you are using.

For example, if you’re using PHP 5.5 it should be something like

C:\Program Files (x86)\IIS Express\PHP\v5.5

Step 3: Edit the PHP.ini file

Open the PHP.ini file in your favourite text editor (for example, Notepad ++).

In here you will need to check and/or change three settings – each must be more than the upload limit you want to set.

Note that megabytes is represented using a capital M, for example 32 megabytes is written as 32M

Search for each of these values and make sure they’re set to more than 32M

  • memory_limit
  • upload_max_filesize
  • post_max_size

Once you save the changes, reload your upload page and you’ll see the upload limit has increased.

If you still have issues uploading, the limit may also be set in the program itself (e.g. the plugin has a limit that hopefully is controlled using a setting).

 

Was this article helpful?

Related Articles