I am getting the post too large exception when I try to upload files which are more than 2 MB in size and I've already tried everything like increasing the post_max_size and max_upload_size in php.ini file but I am still getting the same error. When I comment the handler function in validatepostsize.php file it shows token mismatch error:
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
First, check your PHP version.
The command below will print the path to the php.ini file that your server is using.
Next.
The values of post_max_size, upload_max_filesize and memory_limit by default have the value of 8M, 2M, and 128M respectively.
Search for those variables and change their values, whilst ensuring that the sizes follow the same ratio as the default values.
See example below:
For "heavy-loaded sites", it is useful to have FPM installed and running.
Finally, restart your web server.
One of the issues is that the Laravel
PHP artisan serve
local development server uses the php.ini under PHP/CLI instead of under PHP/apache2So if you are having this issue while developing with
PHP artisan serve
, go and fetch the php.ini that's under the/etc/php[version]/cli
folder.Actually I am looking for the same answer for the same issue. I have found out that the issue can be resolve with an edit of
.htaccess
file.Add the below code in the file.
This above two line will resolve the issue but if you are adding this much size then the line below give will save you from future issue. of like execution time expire and all.
I think you can check the following parameters in your
php.ini
file like:After restart your server like (apache)
Hope this work for you!