when you implement file upload, you find that small files can be uploaded (less than 8M), but when uploading large files, the following error occurs :
Exception ' yii\web\badrequesthttpexception ' with message ' Unable to verify your data submission. ' In/var/www/html/labweb /vendor/yiisoft/yii2/web/controller.php:110
Stack Trace:
#0/var/www/html/labweb/vendor/yiisoft/yii2/base/controller.php: Yii\web\controller->beforeaction (Object (yii\base\inlineaction))
#1/var/www/html/labweb/vendor/yiisoft/yii2/base/module.php (454): yii\base\controller->runaction (' Upload ', Array)
#2/var/www/html/labweb/vendor/yiisoft/yii2/web/application.php (+): yii\base\module->runaction (' Admin/upload ', Array)
#3/var/www/html/labweb/vendor/yiisoft/yii2/base/application.php (375): Yii\web\application->handlerequest ( Object (Yii\web\request))
#4/var/www/html/labweb/web/index.php (): Yii\base\application->run ()
#5 {main}
After finding the data and verifying, finally find the method, modify the Upload_max_filesize and post_max_size parameters of the php.ini file. The following is a modification of the php.ini file under a Linux system.
First enter the command:
cd/etc/php5/apache2/ PS: Since I am installing PHP5, this is done according to the version of PHP I have installed.
Continue to enter the command:
sudo vim php.ini
Enter php.ini, press/To search upload_max_filesize
After finding this parameter, press the I key to enter edit mode, modify parameters, consider the maximum file that your site may upload, set, here I set to 1GB.
Similarly, find and modify the Post_max_size parameter, consider the maximum file settings that your site might upload, and then save it.
Finally, reboot Apache to
sudo/etc/init.d/apache2 Restart
PHP error when uploading large files