Jump to content


- - - - -

How to Change PHP Upload Limit on Ubuntu and Debian

Ubuntu 12.04 Debian 6

  • Please log in to reply
No replies to this topic

#1 Wilson18



  • root
  • 112 posts
  • LocationUniversity of Birmingham

Posted 25 May 2014 - 12:41 PM

On your website, you may find that you need to upload large files to it (more then a few MB’s) so it is useful to change phps upload limits. To do this, we first need to find out where the php.ini file is located. We can do this by writing the following file in one of your new web directories.

nano /var/www/php.php
<?php phpinfo() ?>

Once you have done this, Save and exit. visit localhost/php.php and find the following


Once you have found it, you need to remove the file you have just created and open and edit the config file.

rm /var/www/php.php; nano /etc/php5/apache2/php.ini

When you have the file open, you will see there are almost two thousand lines of code. To find what it is we need, I would recommend using the search function. This is done by pressing Ctrl + W

You will need to see where it says:




You will see that at after each of them it says = and then a number. If you change that value to 25M then it should now allow you to upload files up to 25MBs. It should look something like this:

upload_max_filesize = 25M
post_max_size = 25M


Now, save and exit the file. After this, you will need to restart apache to make sure everything is working.

service apache2 restart

  • Rolandcalm likes this

List what you read?

Check me out on: YouTube, Twitter, Facebook, Google+

Also tagged with one or more of these keywords: Ubuntu 12.04, Debian 6