PHP is a simple and powerful language with core features such powerful solution.upload file size limit is for limiting the client to upload the file size. Usually, the php.ini is used to set the maximum upload file size.
Sometimes, you need to upload a large file to your sites like audio or epub file and the default 8mb limit in the server isn’t enough to upload large files.So you can change your server limit from the php.ini file or directly by the .htaccess file.yes, .htaccess allowed you to increase my max upload file size limit.Using PHP file upload, you can control settings like file upload size, file transfer size etc.
You can increase file upload size from php.ini or from the .htaccess file by adding just three line of code.
- Upload_max_filesize – The maximum file size for uploading a file
- Memory_limit – This sets the maximum amount of memory in bytes.
- Post_max_size – Sets maximum size of the post data allowed. This setting also affects file upload. 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.
NOTE: memory_limit should be larger than post_max_size.
Method 1: php.ini File
If you have an access of php.ini file then you need to add/replace the following line of code into the php.ini file.
memory_limit = 96M upload_max_filesize = 64M post_max_size = 64M
Save and close the file. Restart apache.You can change 32m to whatever max file size you want.
Method 2: .HTACCESS File
Next, if you don’t have an access of php.ini then you can modify file upload size from the .htaccess file by just adding the following line of code into .htaccess file.
php_value memory_limit 96M php_value upload_max_filesize 64M php_value post_max_size 64M
You can use any of the above method to Increase the PHP Max Upload File Size.After modifying the above parameters in PHP.ini, restart your server and upload large files.