Breaking News
Home / Webmaster / How to increase the file upload limit in Drupal?

How to increase the file upload limit in Drupal?

By default the file upload limit is set to 2MB and these days any time of content like audio, video or even photos generally are quite a bit larger. If you try to upload files greater than 2MB, it fails to upload. This limit is defined at the PHP level. So you can change this limit to a higher value by adding the following configuration directives in either one of these files depending on which ever you have access to for your case.

Add to php.ini

This would mean for all websites or php scripts the max upload limit will be set. Depending on your hosting provider you may or may not have access to change this file, but if you do this, it will apply to all your website/scripts that use the same php or default interpreter.

If you don’t know where the php.ini file is located using the following command in the terminal.

livrona@livrona:~$ php -i | grep “Configuration File”
Configuration File (php.ini) Path => /etc/php5/cli
Loaded Configuration File => /etc/php5/cli/php.ini

Now edit the file add the following:

     upload_max_filesize = 100M

     post_max_size = 100M

However, for hosts running PHP as a CGI script with suexec capability may be able to put these directives in a php.ini file in your Drupal root directory, so check your setup for the same.<!>
Add to  .htaccess file in your Drupal root directory.

   Create a new one or add to existing .htaccess file. 

  php_value upload_max_filesize 100M

   php_value post_max_size 100M

This above change will be localized to that particular Drupal instance and you would have to do it for any other website you may have.

Once done, give it a try and the upload limit will be shown in the file upload box as show below.

Drupal increase file upload limit


Check Also

How to reset forgotten password for PHPMotion Admin User?

Solution Basically if you forgot the ‘admin’ user password of the your PHPMotion website. Most …

Advertisment ad adsense adlogger