PDA

View Full Version : Moodle Upload More than 2 Megabytes



milenioz
06-27-2007, 07:17 AM
How can I increase de maximum upload size in HM? I modified the php.ini to 16 megas but my moodle still say 2 megas as maximum size (I think is not a moodle configuration problem because I modified all parameters in moodle and my top size is 2m, so I think is an apache problem.
Any Ideas please :D

charlesgan
06-27-2007, 08:32 AM
check the php.ini in the folder that running the upload script.
change the max upload filezise parameter. you will see 2M as default.

milenioz
06-28-2007, 04:18 AM
Thank you for your response, but I have the same problem after the modification.

Uploaded file exceeded the maximum size limit set by the server

I had modified the php.ini the lines of
; Maximum size of POST data that PHP will accept.
post_max_size = 16M
and the line
; Maximum allowed size for uploaded files.
upload_max_filesize = 16M

I had copied the php.ini in every single subfolder, and I got the same 2megabytes.
I also had cheched the configuration of moodle and it only let me use 2 megabytes.

Any Ideas?

charlesgan
06-28-2007, 09:06 AM
if doing it right, will get the filesize increased.
are your browser cache caused the problem in any possibility?

milenioz
06-28-2007, 04:28 PM
No, is not a browser configuration because I try in differents computers and nothing change. I use the script to copy in all the folders the php.ini
I think is something of the apache configuration. The only parameter that I dont know if I can modified in the php.ini is the
LimitRequestBody 0
but I dont know if the server allows me to do this. Any Idea?
Thank You

This is the script I use to copy php.ini

http://helpdesk.hostmonster.com/kb/index.php?x=&mod_id=2&id=248
Within public_html create a file with the following syntax included within it:

<pre><?php system("find . -type d|xargs -i cp --verbose php.ini {}/."); ?></pre>COMPLETE!

So, if you labeled the file "copyphpini.php" within public_html and you already have the initial PHP.INI file there, you would go to http://www.maindomain.com/copyphpini.php. This will copy the file to every folder below public_html and should there be any problems, reporting the errors verbosely.

milenioz
06-28-2007, 05:38 PM
All things were right but the only thing is the way that I had to writte the limit size.
In the php.ini say 2M
so when I wrote 20M that doesnt work.
But when I wrote 20971520 (in bytes) everything was fine. So the solution is this... I had to copy php.ini in every subfolder, and the size expressed in bytes.
:D

cjritter
06-25-2009, 06:51 PM
Just thought I'd jump in here and say that milenioz's solution worked for me too. Thanks!

jivanac
07-23-2009, 10:50 PM
All things were right but the only thing is the way that I had to writte the limit size.
In the php.ini say 2M
so when I wrote 20M that doesnt work.
But when I wrote 20971520 (in bytes) everything was fine. So the solution is this... I had to copy php.ini in every subfolder, and the size expressed in bytes.
:D

Hi,
Where can I find the php.ini on my cPanel - is it in the moodle directory?

EricJ
07-27-2009, 04:24 PM
You'll need to install a default one if you haven't already.. go to php config on your cPanel in the 'software / services' section. and select IonCube and hit Install Default Master PHP.INI file.

Plus, there is a lot easier way to force this to work, than copying the php.ini into every subfolder (which would create a few thousand php.ini's for me).. Just go to PHP Config on the software services section choose php5 (with single php.ini). and hit save.. even if you have done it before, if it's not working, do it again. it will most likely fix it..

Here is why:
Clicking that button adds this line to all of your .htaccess files:
AddHandler application/x-httpd-php5s .php

A file that is already required in all of your folders. Also, if you needed to raise this limit again.. would you really want to go and edit it for EVERY single php.ini that you've created?

(And for the developers out there who think i made a typo with php5s. I didn't, it stands for 'single').