PDA

View Full Version : PHP Maximum Upload Size


trickfly
02-02-2009, 08:41 PM
How do I change the PHP Maximum Upload Size from 2mb to a higher value ?

I know you edit php.in and the my.cnf file but what do I edit ?

I have access to both files so please help!

m002.p
02-02-2009, 08:51 PM
Its pretty simple, search php.ini for the following lines.

upload_max_filesize = 10M ;
post_max_size = 20M ;

The above would be an example of changing it to 10mb.
Please note I believe sometimes you need to also consider the following:

memory_limit = 8M ;

If you still have issues after trying what ive suggested editing, you might want to try changing the above line to a larger value. It basically is the memory limit for php files on your server and sometimes can prevent uploads from working.

Dont forget you may need to restart apache for the changes to take effect.

Now if this fails, providing you have an apache server and apache uses PHP as a module, you can also make changes to the .htaccess file usually in the root, adding a few simple lines.

Something like this:

php_flag file_uploads On
php_value memory_limit 8M
php_value post_max_size 20M
php_value upload_max_filesize 10M

Hope it helps

Matt

Dismounted
02-03-2009, 05:07 AM
Remember that you need to also restart Apache or your web server.

m002.p
02-03-2009, 08:32 AM
Dont forget you may need to restart apache for the changes to take effect.

:D Indeed

vbplusme
02-03-2009, 09:07 AM
If you have access to the both files then you should not have too much trouble updating them. You might want to do a backup in any event just in case.

CalebD
02-03-2009, 11:19 AM
Hi,

I need to upload files with a filesize of 50-70mb. For testing purposes, I already changed the values in the php.ini and my.cnf as follows:

upload_max_filesize = 100M
post_max_size = 110M
memory_limit = 120M
max_execution_time = 300

Additionally I set:

max_allowed_packet = 128M

I tried to upload a .rar file the size of 48MB. The rar attachment type is added and there are no upload limitations set. If I use the file upload test under 'Maintenance' in the AdminCP, everything works correctly. But if I upload the file as attachment to a post, I get a blank page. I tried both, local and remote upload - same result. Does anybody has a clue?

Apache and MySQL servers are both restarted.

Thx in advance!

Dismounted
02-04-2009, 07:19 AM
Do you get any errors in your logs? Are you storing attachments in the database or the file system?

CalebD
02-04-2009, 06:10 PM
There were no errors in the log files.
Ah, I forgot to try the setting to store attachments in the file system. That seems to work correctly and I can live with that. Thanks for pointing me in the right direction.

emailapphost
03-11-2009, 08:35 AM
How do you "search php.ini"?
And how do you edit it?

In the control panel?
Using telnet?

I really wish the helpfull old timers would be a bit more geared towards newbies in their answers. These threads will be used by newbies for many years going forward. Thanks.

TigerC10
03-11-2009, 08:39 AM
There are a lot of hosting providers that don't let you change the maximum upload size. If you can't find a php.ini file in your webroot directory, then your hosting provider probably doesn't let you change it.

Contact your hosting provider for more information.