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/*

3 Answers 3

0

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
0

Give permission to generated folder

chmod 777 -Rf generated/* var/*

After flush cache

php bin/magento cache:flush
3
  • Thank you for comment, i tried that but still the same error Aug 30, 2018 at 15:23
  • updated answer please try this Aug 30, 2018 at 15:26
  • It still the same error, i gave permissions for generated/* , var/* Aug 30, 2018 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 and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.