Working on setting up a theme for Magento CE 2.2.1. Magento application is running in Centos 7.

Getting this error msg in report.

{"0":"Can't create directory \/var\/www\/html\/magento221\/generated\/code\/Magento\/Framework\/View\/Asset\/MergeService\/. in [Magento\\Framework\\View\\Asset\\MergeService\\Interceptor]","1":"#0 
\/var\/www\/html\/magento221\/vendor\/magento\/framework\/Code\/Generator\/Autoloader.php(35): Magento\\Framework\\Code\\Generator->generateClass('Magento\\\\Framewo...')\n#1 [internal function]: Magento\\Framework\\Code\\Generator\\Autoloader->load('Magento\\\\Framewo...')\n#2 [internal function]: spl_autoload_call('Magento\\\\Framewo...')\n#3 \/var\/www\/html\/magento221\/vendor\/magento\/framework\/Code\/Reader\/ClassReader.php(19): ReflectionClass->__construct('Magento\\\\Framewo...')\n#4 

Gave full permissions to the var folder. chmod 777 var -R. Manually cleared the cache, page_cache and view_processed folders.

Not sure, what is that I am missing. Looking for suggestions/advice. Still a novice in Centos.


Magento in version 2.2 moved var/generation to generated in root folder. You need to add access there as well.

| improve this answer | |
  • Thank you so much. Some of the sub folders under generated was missing write permissions .. Fixed the problem. – p_anantha Dec 15 '17 at 0:09

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.