Magento 2 - Fatal Error "Can't create directory" var/generation/Magento/

This is a permission problem, Magento is unable to write to your var directory.

Please follow the official documentation to setup your permissions properly.


This should help - it sets your permissions based on magento documentation.

sudo find . -type d -exec chmod 770 {} \; && sudo find . -type f -exec chmod 660 {} \; && sudo chmod u+x bin/magento

Please change the generation folder rewrite permission. Thats work for me.

sudo chmod -R 777  var/*