magento2.2.3 - Can't create directory

by Tanvir   Last Updated April 16, 2018 12:09 PM

I am using magento 2.2.3 in ubuntu 16.04. I have transferred a server copy to my local pc. I am having following error

RuntimeException: Can't create directory /var/www/html/new_utshob/generated/code/Magento/Framework/App/Http/. in
[Magento\Framework\App\Http\Interceptor] in
/var/www/html/new_utshob/vendor/magento/framework/Code/Generator.php:115 Stack trace: #0
/var/www/html/new_utshob/vendor/magento/framework/Code/Generator/Autoloader.php
(35): Magento\Framework\Code\Generator->generateClass('Magento\\Framewo...') #1
[internal function]: Magento\Framework\Code\Generator\Autoloader-
>load('Magento\\Framewo...') #2 [internal function]: 
spl_autoload_call('Magento\\Framewo...') #3 
/var/www/html/new_utshob/vendor/magento/framework/Code/Reader/ClassReader.php(19
): ReflectionClass->__construct('Magento\\Framewo...') #4
/var/www/html/new_utshob/vendor/magento/framework/ObjectManager/Definition/Runt
ime.php(44): Magento\Framework\Code\Reader\ClassReader-
>getConstructor('Magento\\Framewo...') #5 
/var/www/html/new_utshob/vendor/magento/framework/ObjectManager/Factory/Dynamic/
Developer.php(48): Magento\Framework\ObjectManager\Definition\Runtime-
>getParameters('Magento\\Framewo...') #6
/var/www/html/new_utshob/vendor/magento/framework/ObjectManager/ObjectManager.p
hp(56): Magento\Framework\ObjectManager\Factory\Dynamic\Developer-
>create('Magento\\Framewo...', Array) #7
/var/www/html/new_utshob/vendor/magento/framework/App/Bootstrap.php(232):
Magento\Framework\ObjectManager\ObjectManager->create('Magento\\Framewo...',
Array) #8 /var/www/html/new_utshob/index.php(38):
Magento\Framework\App\Bootstrap->createApplication('Magento\\Framewo...') #9 
{main} 

Could you please help?

Tags : magento2 ubuntu


Answers 2


Give permission using below command.

chmod -R 0777 /var/www/html/new_utshob
Bhavin iFlair
Bhavin iFlair
April 16, 2018 11:25 AM

Give file permission to your generated/ pub/ var/ folders

sudo chmod -R 777 generated/ pub/ var/

Ranjit Shinde
Ranjit Shinde
April 16, 2018 11:29 AM

Related Questions



How can I redirect Document root to Magento root?

Updated July 13, 2018 05:09 AM


Virtual host for magento2 under lampp service for Ubuntu

Updated September 07, 2018 07:09 AM