I have to upload a pdf file with 34MB. My site is in Linux with php. But my site support only 8MB. (I know this from phpinfo). How I increase the size? I heared that we can change it in php.ini through. htaccess. But where I get php.ini? How I change the size?. Does any one give me a solution ?
Share
There are multiple settings that can affect the maximum file upload size:
PHP_INI_PERDIR: The following settings can be set in php.ini, .htaccess or httpd.conf:
upload_max_filesize
The maximum size of an uploaded file.
post_max_size
Sets maximum size of post data allowed. To upload large files, this value must be larger than upload_max_filesize. If memory limit is enabled by your configure script, memory_limit also affects file uploading.
max_input_time
This sets the maximum time in seconds a script is allowed to parse input data, like POST, GET and file uploads.
PHP_INI_ALL: The following settings can be set in php.ini, .htaccess, httpd.conf, or with ini_set():
max_execution_time
This sets the maximum time in seconds a script is allowed to run before it is terminated by the parser. If this limit is too low, your script will terminate before a large file has had time to upload.
memory_limit
This sets the maximum amount of memory in bytes that a script is allowed to allocate. If memory limit is enabled by your configure script, memory_limit also affects file uploading. Generally speaking,
memory_limitshould be larger thanpost_max_size.POST upload method
When uploading files via the POST method, you also need to set
MAX_FILE_SIZEin your HTML form. See this for more details:http://www.php.net/manual/en/features.file-upload.post-method.php
Shared hosting
If you are using shared hosting, it is unlikely that you will be able to access the system php.ini file. However, you can set the values in .htaccess or in a per-directory php.ini file. Some shared hosting providers may prevent you from doing this, so you will need to check if this is the case.
.htaccess
Here’s a sample .htaccess file:
Per-directory php.ini
The above settings can also be changed in a per-directory php.ini file. Again, the ability to do this may be restricted by your hosting provder. For more information on this, see here:
http://www.askapache.com/php/custom-phpini-tips-and-tricks.html
Changeable:
For a description of the PHP_INI_* modes, which show where configuration directives may be set, see here:
http://php.net/manual/en/configuration.changes.modes.php