0

enter image description here Encounter this issue (Layout are wrong ).What is the possible issue for this?

Tried dicompile, clear cache and reindex.Still not working

exception.log

main.CRITICAL: Path "/var/www/html/var/view_preprocessed/pub/static/" cannot be used with directory "/var/www/html/var/view_preprocessed/pub/static/" {"exception":"[object] (Magento\Framework\Exception\ValidatorException(code: 0): Path \"/var/www/html/var/view_preprocessed/pub/static/\" cannot be used with directory \"/var/www/html/var/view_preprocessed/pub/static/\" at /var/www/html/vendor/magento/framework/Filesystem/Directory/PathValidator.php:61)"} [] main.CRITICAL: The specified "/var/www/html/generated/code/Magento/Framework/App/Http/Interceptor.php.13900" file could not be written Warning!file_put_contents(/var/www/html/generated/code/Magento/Framework/App/Http/Interceptor.php.13900): failed to open stream: Permission denied Class Magento\Framework\App\Http\Interceptor 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. {"exception":"[object] (RuntimeException(code: 0): The specified \"/var/www/html/generated/code/Magento/Framework/App/Http/Interceptor.php.13900\" file could not be written Warning!file_put_contents(/var/www/html/generated/code/Magento/Framework/App/Http/Interceptor.php.13900): failed to open stream: Permission denied Class Magento\Framework\App\Http\Interceptor 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. at /var/www/html/vendor/magento/framework/Code/Generator.php:135)"} []

4
  • you have run deploy command? Commented Jun 20, 2019 at 7:19
  • yes command that i have insert : sudo php bin/magento setup:upgrade && sudo php bin/magento setup:di:compile && sudo php bin/magento setup:static-content:deploy Commented Jun 20, 2019 at 7:19
  • you can check first css and js already available or not ? after given permission of pub var genrated folder sudo chmod -R 0777 pub var generated Commented Jun 20, 2019 at 7:26
  • can you elaborate which css and js i should check?I think i have the proper permission based on this magento.stackexchange.com/a/278519/60921 Commented Jun 20, 2019 at 7:53

2 Answers 2

0

1.Set Magento 2 recommend permission to folder and files.

https://devdocs.magento.com/guides/v2.3/config-guide/prod/prod_file-sys-perms.html

https://magento.stackexchange.com/a/278519/60921

2.Clear regenerated

 rm -rf var/cache/ generated/ var/page_cache/ var/view_preprocessed/ pub/static/ 

3.Run upgrade and static-content commands

php bin/magento setup:upgrade php bin/magento setup:static-content:deploy -f 
10
  • tried as according to exact steps ,not working (same result ) Commented Jun 20, 2019 at 7:46
  • Add your error log Commented Jun 20, 2019 at 7:47
  • are you refering system log ? Commented Jun 20, 2019 at 7:51
  • exception.log or system.log or apache error.log Commented Jun 20, 2019 at 7:54
  • set file permission as root user Commented Jun 20, 2019 at 7:59
0

Run this commands from the Magento Root directory

find . -type f -exec chmod 664 {} \; find . -type d -exec chmod 775 {} \; find ./var -type d -exec chmod 777 {} \; find ./pub/media -type d -exec chmod 777 {} \; find ./pub/static -type d -exec chmod 777 {} \; chmod 777 ./app/etc chmod 644 ./app/etc/*.xml chmod u+x bin/magento 
1
  • not working,is there any other possibilities that it is from apache2 overwrite? Commented Jun 23, 2019 at 8:57

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.