When I clicked on add to cart or add product in wishlist then showing error as below:

enter image description here

How can I fix this issue ? Where is the form key to change or what can I do ?


Change your baseurl from http://localhost/ to

From Admin Panel :

Stores > Settings > Configuration > General > Web

Change Base URLs & Secure Base URL (Secure)

Using command line :


mysql -u $database_user -p $database_name

Access the database

use database

select * from core_config_data where path like '%base%url%';

Update Base Url :

update core_config_data set value = 'http://example.com/' where path = 'web/unsecure/base_url';

update core_config_data set value = 'https://example.com/' where path = 'web/secure/base_url';

Clean cache:

php bin/magento cache:clean
| improve this answer | |

go to your env.php file and set the base url from localhost to location for env.php file is <magento root directory>app\etc

and then go to you php.ini file and look for this line max_input_var=100000 now just flush:cache and you are done

| improve this answer | |
  • max_input_vars search this and update the value – Pramod Dec 13 '19 at 11:07
  • I have done changes as you suggest but still I'm facing same error – RK7002 Dec 13 '19 at 11:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.