문제

[Ubuntu 18.04 / Apache 2.4 / PHP 7.2.17 / Magento 2.3.1]

After successful installing, magento show blank page. I found following error in apache error.log:

[php7:error] [pid 29252] [client 127.0.0.1:45454] PHP Fatal error: Uncaught RuntimeException: Can't create directory /var/www/html/magento/generated/code/Magento/Framework/App/ResourceConnection/.\nClass Magento\Framework\App\ResourceConnection\Proxy generation error: The requested class did not generate properly, because the 'generated' directory permission is read-only. If --- after running the 'bin/magento setup:di:compile' CLI command when the 'generated' directory permission is set to write --- the requested class did not generate properly, then you must add the generated class object to the signature of the related construct method, only. in /var/www/html/magento/vendor/magento/framework/Code/Generator.php:135\nStack trace:\n#0 /var/www/html/magento/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/magento/vendor/mag in /var/www/html/magento/vendor/magento/framework/Code/Generator.php on line 135

I have set chmod -R 777 /var/www/html/magento/generated. But it's showing the same error. Can you help?

도움이 되었습니까?

해결책

You have to give permissions to var pub and generated directories. cd into your magento installation and run following command;

chmod -R 777 var pub generated

you may also need to run setup upgarade and deploy static files so run following commands too ;

php bin/magento s:up && php bin/magento s:s:d -f && chmod 777 -R  var pub generated
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top