0

Environment: Magento2 2.2.5 / PHP 7.0.28

Fatal error: Uncaught RuntimeException: Can't create directory /opt/lampp/htdocs/Procfit-Institucional/generated/code/Magento/Framework/App/ResourceConnection/. in [Magento\Framework\App\ResourceConnection\Proxy] in /opt/lampp/htdocs/Procfit-Institucional/vendor/magento/framework/Code/Generator.php:115 Stack trace: #0 /opt/lampp/htdocs/Procfit-Institucional/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 /opt/lampp/htdocs/Procfit-Institucional/vendor/magento/framework/Code/Reader/ClassReader.php(19): ReflectionClass->__construct('Magento\Framewo...') #4 /opt/lampp/htdocs/Procfit-Institucional/vendor/magento/framework/ObjectManager/Definition/Runtime.php(44): Magento\Framework\Code\Reader\ClassReader->getConstructor('Magento\Framewo...') #5 /opt/lampp/htdocs/Procfit-Institucion in /opt/lampp/htdocs/Procfit-Institucional/vendor/magento/framework/Code/Generator.php on line 115

I already tried:

sudo chmod 777 -R on my root project 
sudo chmod -R 777  var/*
1

Try to launch in your magento directory :

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

It will fix perm like Magento documentation.

0

Give permission to generated folder

chmod 777 -Rf generated/* var/*

After flush cache

php bin/magento cache:flush
  • Thank you for comment, i tried that but still the same error – Caio Pereira Aug 30 '18 at 15:23
  • updated answer please try this – Prashant Valanda Aug 30 '18 at 15:26
  • It still the same error, i gave permissions for generated/* , var/* – Caio Pereira Aug 30 '18 at 15:33
0

Give permissions to the generated folder

Steps:

  1. Go To - cd /opt/lampp/htdocs
  2. sudo chmod 777 -R magento (or Your Package folder name).

Then Check

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.