Hello everyone! I'm struggling with this configuration issue because I'm trying to increase the file upload size capacity in the Apache configuration but don't know how to do it exactly. I found this article discussing this but would like to know the correct way to change .htaccess.
https://brightwhiz.com/increase-file-upload-size-apache/
I'm trying to solve the problem of not being able to upload files larger than 5MB in php (laravel), so I found this solution in this article. What is the correct way to configure my .htaccess to do this?
I have tried these configurations
<IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews -Indexes </IfModule> RewriteEngine On # Handle Authorization Header RewriteCond %{HTTP:Authorization} . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] # Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} (.+)/$ RewriteRule ^ %1 [L,R=301] # Send Requests To Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] <Directory "/var/www/html/assets"> LimitRequestBody 67108864 </Directory> </IfModule>
<IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews -Indexes </IfModule> RewriteEngine On # Handle Authorization Header RewriteCond %{HTTP:Authorization} . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] # Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} (.+)/$ RewriteRule ^ %1 [L,R=301] # Send Requests To Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </IfModule> <Directory "/var/www/html/assets"> LimitRequestBody 67108864 </Directory>
The upload_max_filesize and post_max_size settings in php.ini need to be changed to support files larger than php's default allowed size.
Set upload_max_filesize to the maximum size of the file that needs to be uploaded.
Set memory_limit to the amount of memory required to run the php script, and set max_execution_time to the time in seconds required to run the script.