For configuring the size of upload file, post, memory in an application developed in php we need to do the following changes in the file php.ini. The path where we can find the php.in is below:
1-> Debian/ Ubuntu : { /etc/php5/apache2/php.ini }
2-> Centos/ Fedora : { /etc/php.ini }
1. Change the default value of upload_max_filesize from 2mb to 14mb :
#Maximum allowed size for uploaded files.
# http://php.net/upload-max-filesize
upload_max_filesize = 2M
2. Similarly we can also change the number of file that can be uploaded in on request
#Maximum number of files that can be uploaded via a single request
max_file_uploads = 20
3. In the similar manner we can change the maximum post size by changing the value of
post_max_size from default value 8M to the required size.
#Maximum size of POST data that PHP will accept.
#Its value may be 0 to disable the limit. It is ignored if POST data reading is disabled through
#enable_post_data_reading.
post_max_size = 8M
4. We can also change the memory limit
# Maximum amount of memory a script may consume (128MB) default
memory_limit = 140M
Note:
Value of [ post_max_size > upload_max_filesize ] & Value of [memory_limit > post_max_size ]
0 Comment(s)