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)"} []
2 Answers 2
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
-
tried as according to exact steps ,not working (same result )Ed Tan– Ed Tan2019年06月20日 07:46:12 +00:00Commented Jun 20, 2019 at 7:46
-
Add your error logArunprabakaran M– Arunprabakaran M2019年06月20日 07:47:06 +00:00Commented Jun 20, 2019 at 7:47
-
are you refering system log ?Ed Tan– Ed Tan2019年06月20日 07:51:57 +00:00Commented Jun 20, 2019 at 7:51
-
exception.log or system.log or apache error.logArunprabakaran M– Arunprabakaran M2019年06月20日 07:54:29 +00:00Commented Jun 20, 2019 at 7:54
-
set file permission as root userArunprabakaran M– Arunprabakaran M2019年06月20日 07:59:40 +00:00Commented Jun 20, 2019 at 7:59
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
-
not working,is there any other possibilities that it is from apache2 overwrite?Ed Tan– Ed Tan2019年06月23日 08:57:55 +00:00Commented Jun 23, 2019 at 8:57
sudo chmod -R 0777 pub var generated