TinyPortal

Development => Support => Topic started by: nadrojcote on April 05, 2009, 03:32:01 AM

Title: TPDownload size limit problem
Post by: nadrojcote on April 05, 2009, 03:32:01 AM
I am having a problem with my tpdownload, no matter what I change my size limit to it doesnt actually change, it will only allow me to upload files smaller than 2 MB even when i set the limit to 2GB, anyone help on this would be greatly appreciated, thanks
Title: Re: TPDownload size limit problem
Post by: ZarPrime on April 05, 2009, 03:41:41 AM
Hi nadrojcote,

Welcome to TinyPortal.

This is either a permissions issue with your tp-downloads folder or your host has set a limit on the size of files you can upload.  Check the file permissions for that folder and set it to 777 if it isn't already set to that.  If that isn't the issue, then ask your host to increase your php_value upload_max_filesize  to 50M or whatever size you want.

ZarPrime
Title: Re: TPDownload size limit problem
Post by: nadrojcote on April 05, 2009, 04:04:03 AM
Thank you for the very fast reply, I have tried changing the permissions on the tpdownloads folder and that didnt work as well I have uploaded a file larger than 2MB through FTP so I dont think there is a limit on it. My hosting is through hostmonster and it basically has unlimited everything.
Title: Re: TPDownload size limit problem
Post by: ZarPrime on April 05, 2009, 04:29:42 AM
FTP uploads aren't the same as php uploads.  As you have surmised, the temporary workaround for not being able to upload larger files via php is to upload them via FTP and then use the FTP function in TP to assign them to a category.

However, even though your host might have unlimited on everything there is a very good chance that there is a php upload_max_filesize in place.  Most hosts that I have seen have this set to 2 MB.  You can check yours by putting the following into a file called info.php and uploading it to your /public_html folder ...

<?php phpinfo(); ?>

Upload this to your /public_html folder of your domain and then navigate to it in your browser.  For instance "http://YourSite.com/info.php".

Under PHP Core Configuration, look for "upload_max_filesize".  There will be 2 values, a local value and a master value.  If they are both set to 2M then that is the problem.  You can ask your host to increase the local value to whatever you want, or you can do this yourself if you know how to.  For instance, on mine, the Master Value is 2M, but I have set the Local Value to 50M.

ZarPrime
Title: Re: TPDownload size limit problem
Post by: Renegd98 on April 05, 2009, 05:31:48 AM
Zar I believe you hit the nail on the head.  The default upload limit in php is set to 2M. he will need to get his host to change that.
Title: Re: TPDownload size limit problem
Post by: Inny on April 05, 2009, 07:38:07 AM
I think hostmaster uses Cpanel.

If you have cpanel for your hosting go to php.ini QuickConfig.

You will get to a new page with many options, find upload_max_filesize and change it to the value you want. (E.G.: 500M).

Additionaly you might have to change memory_limit, make it 64M.

Values that work for me:
upload_max_filesize = 500M
memory_limit = 64M

If you get timeout errors while uploading very large files you need to change:
max_execution_time = 600
max_input_time = 600

All the values posted above is what is works for ME. You can go lower i wouldn't suggest going higher. Those values i use is mainly to upload some kind of videos in the download section. For any other reason i wouldn't suggest them
Title: Re: TPDownload size limit problem
Post by: nadrojcote on April 05, 2009, 05:49:20 PM
Thanks guys, you were right, I had to go into cpanel and then to PHP config and create a php.ini, then i ftp'd in to edit it and changed the settings you said. one other thing is that it was called php.ini.default should I leave it like this or rename it to php.ini?
Title: Re: TPDownload size limit problem
Post by: G6Cad on April 05, 2009, 05:53:43 PM
When you set the limit on file size, you have to change the linit for the time the file takes to be uploaded, or you will have the same issues even if you change the file size limit.

Cant remember ontop of my head what valuse you have to change for the time, but some one else will answer that for you im sure.
Title: Re: TPDownload size limit problem
Post by: Inny on April 05, 2009, 06:43:10 PM
Quote from: nadrojcote on April 05, 2009, 05:49:20 PM
Thanks guys, you were right, I had to go into cpanel and then to PHP config and create a php.ini, then i ftp'd in to edit it and changed the settings you said. one other thing is that it was called php.ini.default should I leave it like this or rename it to php.ini?

As far as i know you should keep it i like that.

Title: Re: TPDownload size limit problem
Post by: Renegd98 on April 05, 2009, 06:45:50 PM
It needs to be named php.ini
Title: Re: TPDownload size limit problem
Post by: Inny on April 05, 2009, 06:54:13 PM
Quote from: Renegd98 on April 05, 2009, 06:45:50 PM
It needs to be named php.ini

He said he already created a php.ini. Renaming php.ini.default back to php.ini will get him his original values back.

hmm slightly confused now :P
Title: Re: TPDownload size limit problem
Post by: Renegd98 on April 05, 2009, 08:51:40 PM
Yes, your right. If he created a php.ini then he needs to leave the .default file alone.
Title: Re: TPDownload size limit problem
Post by: ZarPrime on April 06, 2009, 05:51:28 PM
As a side note, on most hosts you can change the local value by adding the following line to the .htaccess file in your /public_html folder ...

php_value upload_max_filesize 50M

Change the 50 to whatever value you want to have.  Much easier.  Every folder below that will inherit the same value.

ZarPrime
Title: Re: TPDownload size limit problem
Post by: Renegd98 on April 06, 2009, 11:34:23 PM
I assume this cause no security issues... though I see no way it should...
Title: Re: TPDownload size limit problem
Post by: ZarPrime on April 07, 2009, 01:27:58 AM
I don't think it does.  I've never had any problem with it.  In fact, my host is the one that told me to do it.  However, Ichbin would probably know the answer to that better than me.  He' knows a lot more about htaccess files and such than I do.

ZP
Title: Re: TPDownload size limit problem
Post by: Inny on April 07, 2009, 06:29:15 AM
Quote from: Renegd98 on April 06, 2009, 11:34:23 PM
I assume this cause no security issues... though I see no way it should...

If you are using .htaccess for mod rewrites or php settings and especially password protected folders you have to deny access for everyone.


<Files .htaccess>
order allow,deny
deny from all
</Files>