XHanch Studio Log in | Register | Cart

Forum

[How to] Increase/c...
 
Notifications
Clear all

[How to] Increase/change max upload/post size for PHP scripts

8 Posts
2 Users
0 Likes
10.6 K Views
XHanch
(@xhanch-alt)
Posts: 2105
Member Admin
Topic starter
 

Depending on your host or server's configuration, you can change the value of max upload size and max post size parameters for your PHP by editing your php.ini file or .htaccess file.

Let's say that you want to set the upload limit to 10 MB. You can choose one of these three solutions.

If you own a VPS or dedicated server, you can edit your global php.ini. Location to your php.ini may be different on your server depending on how you install/setup your PHP. But, usually, it is located on /etc/php.ini. So you can edit that file using this command

vi /etc/php.ini

You just need to find upload_max_filesize and post_max_size and change the value to 10MB. The PHP documentation states that the memory_limit setting also affects file uploading. Generally speaking, memory_limit should be larger than post_max_size.

As you finished, you will need to restart your apache.

service httpd restart

As another solution, you add the below codes to your .htaccess file in your website root directory (usually public_html).

php_value upload_max_filesize 10M
php_value post_max_size 10M

As the last solution, add the below to the relevant php.ini file (recommended, if you have access). Note that for some hosts this is a system-wide setting. However, for hosts running PHP as a CGI script with suexec (for example) you may be able to put these directives in a php.ini file in your website root directory.

upload_max_filesize = 10M
post_max_size = 10M
 
Posted : 11/03/2011 5:20 am
(@djchayan)
Posts: 21
Member
 

Hi! i've set upload limits and etc at 30m even the timeout was raised to 300secs and still not able to upload anything that's more than 10m I keep getting an "page could not load" "the connection to the server was reset while this page was loading" unless i do directly thru cpanel file manager. and i've noticed that sometimes they end up giving then a broken image report... :'(

 
Posted : 09/04/2012 2:16 pm
XHanch
(@xhanch-alt)
Posts: 2105
Member Admin
Topic starter
 

Hi! i've set upload limits and etc at 30m even the timeout was raised to 300secs and still not able to upload anything that's more than 10m I keep getting an "page could not load" "the connection to the server was reset while this page was loading" unless i do directly thru cpanel file manager. and i've noticed that sometimes they end up giving then a broken image report... :'(

How about your max_input_time?

 
Posted : 09/04/2012 5:37 pm
(@djchayan)
Posts: 21
Member
 

300 too

 
Posted : 09/04/2012 6:51 pm
XHanch
(@xhanch-alt)
Posts: 2105
Member Admin
Topic starter
 

300 too

Could you PM me an URL to your PHP Info page?

 
Posted : 10/04/2012 6:32 am
(@djchayan)
Posts: 21
Member
 

sent!  8)

 
Posted : 10/04/2012 6:44 am
XHanch
(@xhanch-alt)
Posts: 2105
Member Admin
Topic starter
 

Hi! i've set upload limits and etc at 30m even the timeout was raised to 300secs and still not able to upload anything that's more than 10m I keep getting an "page could not load" "the connection to the server was reset while this page was loading" unless i do directly thru cpanel file manager.

I can't find something wrong with your server configuration.
Please try to contact your hosting provider

 
Posted : 10/04/2012 10:51 pm
(@djchayan)
Posts: 21
Member
 

The max upload size etc was modified by them still didnt work...but now after possibly a db restart it started to let me upload above 10mb will let you know of any changes thanks i guess is fixed

 
Posted : 11/04/2012 9:25 am
Share:

× Close Menu