Increase file upload size in Apache configuration
P粉512526720
P粉512526720 2023-11-11 11:00:33
0
1
660

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

  Options -MultiViews -Indexes  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]  LimitRequestBody 67108864  
  Options -MultiViews -Indexes  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]   LimitRequestBody 67108864 


P粉512526720
P粉512526720

reply all (1)
P粉957723124

Theupload_max_filesizeandpost_max_sizesettings inphp.inineed to be changed to support files larger than php's default allowed size.

Setupload_max_filesizeto the maximum size of the file that needs to be uploaded.

Setmemory_limitto the amount of memory required to run the php script, and setmax_execution_timeto the time in seconds required to run the script.

upload_max_filesize=30M post_max_size=31M memory_limit = 100M max_execution_time = 120
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!