First ,we install /var/www/html/magento2 , but something happened and we are not sure why we can not log in, so we re-install a new magento2 in /var/www/html/magento23 , but when we try to log in from the browse , the same problem happened ?? Please help us.
Warning: Uncaught Exception: Warning: require(/var/www/html/magento2/pub/errors/report.php): failed to open stream: Permission denied in /var/www/html/magento2/vendor/magento/framework/App/Http.php on line 361 in /var/www/html/magento2/vendor/magento/framework/App/ErrorHandler.php:61 Stack trace: #0 /var/www/html/magento2/vendor/magento/framework/App/Http.php(361): Magento\Framework\App\ErrorHandler->handler(2, 'require(/var/ww...', '/var/www/html/m...', 361, Array) #1 /var/www/html/magento2/vendor/magento/framework/App/Http.php(361): require() #2 /var/www/html/magento2/vendor/magento/framework/App/Http.php(181): Magento\Framework\App\Http->handleGenericReport(Object(Magento\Framework\App\Bootstrap), Object(Magento\Framework\Exception\FileSystemException)) #3 /var/www/html/magento2/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\Http->catchException(Object(Magento\Framework\App\Bootstrap), Object(Magento\Framework\Exception\FileSystemException)) #4 /var/www/html/magento2/vendor/magento in /var/www/html/magento2/vendor/magento/framework/App/ErrorHandler.php on line 61
Fatal error: Magento\Framework\App\Http::handleGenericReport(): Failed opening required '/var/www/html/magento2/pub/errors/report.php' (include_path='/var/www/html/magento2/generated/code:/var/www/html/magento2/generated/code:/var/www/html/magento2/vendor/magento/zendframework1/library:.:/usr/share/pear:/usr/share/php') in /var/www/html/magento2/vendor/magento/framework/App/Http.php on line 361
Hi @alex_chang1
There might be some issue with the deployment. You can regenerate generated folder using compile command.
Try the following command once:
find . -type d -exec chmod 755 {} \; && find . -type f -exec chmod 644 {} \; && chmod u+x bin/magento
You can use sudo as well.
Then try following commands once n sequence to re generations.
chmod -R 0777 var/ pub/ generated/ rm -rf var/cache/* var/view_preprocessed/* generated/* pub/static/* php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy -f php bin/magento cache:flush
I hope it will help you!
Hello
Thanks for the suggestion . However. after using your commands , the problem is still the same.
Should we un-install the previous Magento 2 first ? But we do not know how to un-install it.
Hi @alex_chang1
BTW it looks like a permission error only.
Have you tried using sudo user?
sudo chmod -R 0777 var/ pub/ generated/
For uninstall, you can delete installed magento folder and drop database.
I hope it might help you!