When I tried to upgrade Magento from 1.9.2 to 2.0.0 got the following error

Fatal error: Uncaught exception 'Magento\Framework\Exception\LocalizedException' with message 'Can't create directory vendor/magento/framework/Code/Generator.php on line 103

Please could anyone help me solve this issue?

  • Toss out a good portion of what you know about Mage 1.x, don't be committing this on your live ecommerce server, you will be committing seppuku before the night's through. – Fiasco Labs Nov 19 '15 at 7:47
  • That, Sir, is the most precise answer ever for "upgrading from 1.9 to 2.0"!!! Thank you for lightening up my day :) (I'm serious!) – Java_Waldi Dec 21 '15 at 9:29

Make read/write permission for var directory. That means var directory should be 0777.

  • Does it include All Sub Folder of var to 777 permission? – Ankit Shah Oct 3 '16 at 3:16

Giving full permission (777) to var and pub directory after upgrade

Run below commands.

php bin/magento setup:upgrade

chmod -R 777 var pub

clear cache.

rm -rf var/cache/* var/generation/*

Also getting error

unable to create directory inside var directory

during installation of magento 2. It was because I have given 755 permissions to var folder. Changing it 777 worked like a charm.


It is not possible to upgrade Magento 1.x to Magento 2.
It is possible to migrate data from an existing Magento 1.x shop to a new Magento 2 shop.
There is the official data migration tool: https://github.com/magento/data-migration-tool-ce

  • Hello @Mage2.PRO, can i get help regard Magento 2.3 installation error like [ERROR] RuntimeException: The path "C:/wamp/www/giri/generated/code/Magento/Directory/Helper/Data/Proxy.php.2984" cannot be renamed into "C:/wamp/www/giri/generated/code/Magento/Directory/Helper/Data/Proxy.php" how can i solve this error? – Gem Dec 20 '18 at 7:28

var/generation folder has been renamed to generated/code in Magento 2.2

So make sure to set permission to that folder.

chmod -R -v 777 generated/
  • This really help me sort a problem out. We were implementing a new template on 2.2.5 and it involved updating and compiling. After doing this with no errors visible whilst executing we were getting 500 errors accessing the site. Added the error output and found it could not write a swatch the generated set of folders. Changed as per your instructions and works perfectly now! Thanks anyway as not related to the post but obviously works for other errors - noted it does not mention this in the Magento instructions unless I missed it? – ZipNFC Aug 18 '18 at 10:34

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

sudo chmod -R 777  var/*

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.