PDA

View Full Version : drupal - how to increase upload limit


martindx
11-09-2006, 02:49 PM
I want to be able to upload files up to about 15Mb using the upload module in Drupal
The limit seems to be 5Mb, does anyone have any ideas how to do this with SG hosting?

I've looked on drupal forums and there's talk of editing php.ini, but I can't find it...

ianoakley
12-21-2006, 03:12 AM
I want to do the same and editing settings.php and .htaccess (in line with the drupal forums) don't seem to be working. Did you find a solution?

Bill
12-21-2006, 03:43 PM
Hello,

Generally, the limit of the max upload file size via php is set to 5MB.

You can change it by creating a php.ini file and placing it in the folder you want it to apply to.

The php.ini file must contain upload_max_filesize = 15MB

Skash
12-21-2006, 05:32 PM
Hello,

Generally, the limit of the max upload file size via php is set to 5MB.

You can change it by creating a php.ini file and placing it in the folder you want it to apply to.

The php.ini file must contain upload_max_filesize = 15MB

Bill, would that work for other PHP scripts, such as.... PHP-Nuke?

ianoakley
12-21-2006, 09:34 PM
This works a treat thanks. However, when I use a php.ini file I subsequently get errors of the following sort:
"Fatal error: Only variables can be passed by reference in /mysite/modules/filefield/filefield.module on line 299"

As you can see, I am using the CCK filefield module, and checking the code for this, I found it is just a problem with some standard code to get the file extension from a filename. I removed the code and hardcoded strings and all is well.

The offending lines have the following form:
$ext = array_pop(explode('.',$file['filename'])); // changed to $ext = "mpg";

Anyway, before I fix the php code properly, I was wondering if there is a simple php.ini setting which will resolve this problem.

Thanks in advance.

Disclaimer: complete newbie for php...

Bill
12-22-2006, 05:44 AM
Unfortunately, I have no idea which setting of the global php.ini file is needed for your application to work.

It needs to be examined by a local php developer to check which setting it fails to detect and prints out this error.

glorybound
01-01-2007, 12:24 AM
Anyway to access the php.ini? I created my own, but the script having issues with upload sizes doesn't work after I create my own php.ini. Any help would be greatly appreciated.

Bill
01-03-2007, 02:44 AM
Unfortunately, you dont have access to the global php.ini file.

Please set all needed options in a local php.ini file that should be placed in the folder you want it to apply to.

glorybound
01-04-2007, 02:31 PM
How do I go about getting a copy of the ini to place in my script folder. I can use one I have from my local server, but the paths will not be the same.

Bill
01-05-2007, 03:18 AM
You dont really need the whole php.ini file.

Just create a blank php.ini file and put in it the values you want changed.

This way only the ones described in the local php.ini will take effect. All others will be retrieved from the global php.ini file.

For example if you want to change the register globals value insert in the php.ini:

register_globals = On

beyoyo2
10-19-2009, 11:29 AM
I put a php.ini file in my folder where I need the upload size to be larger (50mb) but I still can only upload files below 24mb...
It doesn't seem to be taking the change.

Val
10-26-2009, 07:53 AM
There are various settings you need to change in order to be able to upload files bigger than 24MB which is by default. You might want to try changing

max_upload_filesize = 50M

as well as

post_max_size = 50M

(above example sets the limit to 50MB). Without the post max size directive, the first one won't do anything.