I am using php 7.2.13 version and magento 2.3 latest version in xampp. When i do add to wishlist and save anything am getting Invalid Form Key. Please refresh the page? this error.

  1. Change your Baseurl and Baseurl secure to instead of localhost

    run cache:flush

  2. Or delete all directories below var/cache


Life saver. This worked for me. It also solved my other problem of getting a blank admin panel page. I am testing a fresh install of Magento 2.1.3 on WAMP.

Other fixes I needed to make it work on WAMP:


Changes at line 138:

    //$realPath = $this->fileDriver->getRealPath($path);
    $realPath = str_replace('\\', '/', $this->fileDriver->getRealPath($path));
  • ROOT > var > cache > DELETE ALL
  • ROOT > var > page_cache > DELETE ALL
  • ROOT > var > session > DELETE ALL



<item name="view_preprocessed" xsi:type="object">Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink</item> 


<item name="view_preprocessed" xsi:type="object">Magento\Framework\App\View\Asset\MaterializationStrategy\Copy</item>

So many answers difficult to get answers that work for you. WAMP related answers were difficult to find for 2.3.1.

Besides, it is so hard to get Magento 2.x versions to work straight away. Still struggling to make it work on Ubuntu 18.04.

  • Try using docker instead of wamp May 20 '19 at 23:03

This problem is occurred after adding more custom options so because php.ini file not allowed to add more custom options.

So, we need to change default settings of php.ini file.

If php version 7.1 then,


If php version 7.0 then,


If php version 7.2 then,


Uncomment this value and update this all value in php.ini,

max_input_vars = 200000
max_input_time = 600
max_execution_time = 3600

Then Restart Apache 2 web server, and check it.

sudo service apache2 restart

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.