large file upload
I am trying to upload a file which is 4mb in size but the max upload size is 2mb
I tried with using .htaccess but not working its showing 500 internal server error.
Anyother ideas please
You will need to change this setting inside of php.ini
This setting can not be changed inside of your php script.
Here is a brief outline of what you will need to do (on a *NIX host):
1) find php.ini (*!*possibly called php5.ini)
# you can use
# user@host> php -i | fgrep '.ini'
# or you can make a webpage and put "<?php phpinfo(); ?>" then open it in a browser, its near the top
2) copy php.ini to your php scripts directory
# you can use
# user@host> cp /path/to/php.ini ~webdir/upload/php.ini
# or you can use an FTP client
3) open php.ini in your script's directory (with a text editor)
# upload_max_filesize = xxxM
# is the directive you want to edi
# where xxx is an integer and M means megabyte
4) save it/done
I find that people have issues around 80MB, at which point you will need to learn more about how uploads work (I don't have timem but it's not exactly clear cut from what I can tell) or force uploaders to compress / split files.
You may also want to consider changing.
memory_limit = xxxM
post_max_size = xxxM
file_uploads = On | Off
If you intend to store the files in mysql as a blob, you will likely have to change the max packet size for mysql also.
Last edited by eval(BadCode); 02-05-2011 at 10:10 PM.
Thanks for your suggestion....
but the problem is that how can I get the php.ini file....the site is hosted in shared server...or shall I request the host to provide the php.ini file?
thanks once again mate
Rename this file to "php.ini" and add it to your PHP script's directory.
Last edited by eval(BadCode); 02-06-2011 at 09:12 AM.
You probably cannot modify the php.ini file on your shared host. Simply creating a local copy will not affect how your PHP scripts run, since PHP is normally invoked by the web server as an Apache module, and the php.ini settings are only applied when the web server in initiated. For that particular setting, the only other option is to change it via a local .htaccess file, and that can only work if your host's Apache configuration both allows personal .htaccess files in general and in specific allows the use of the php_value directive in them. You'll have to check with your hosting admin and/or FAQ if that is the case.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
How to Ask Questions the Smart Way
(not affiliated with this site, but well worth reading)
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)