New to Magento trying to upload Magento 2 CE onto my localhost to learn.
Installed XAMPP, downloaded Magento, unzipped entire folder to htdocs.
Getting an error:
Fatal error: Uncaught Magento\Framework\Exception\FileSystemException: The "/opt/lampp/htdocs/magento2/var/.regenerate" file can't be deleted. Warning!unlink(/opt/lampp/htdocs/magento2/var/.regenerate): Permission denied in /opt/lampp/htdocs/magento2/vendor/magento/framework/Filesystem/Driver/File.php:384 Stack trace: #0 /opt/lampp/htdocs/magento2/vendor/magento/framework/Filesystem/Directory/Write.php(188): Magento\Framework\Filesystem\Driver\File->deleteFile('/opt/lampp/htdo...') #1 /opt/lampp/htdocs/magento2/vendor/magento/framework/Code/GeneratedFiles.php(99): Magento\Framework\Filesystem\Directory\Write->delete('/var/.regenerat...') #2 /opt/lampp/htdocs/magento2/vendor/magento/framework/App/ObjectManagerFactory.php(111): Magento\Framework\Code\GeneratedFiles->cleanGeneratedFiles() #3 /opt/lampp/htdocs/magento2/vendor/magento/framework/App/Bootstrap.php(210): Magento\Framework\App\ObjectManagerFactory->create(Array) #4 /opt/lampp/htdocs/magento2/vendor/magento/framework/App/Bootstrap.php(125): Magento\Framework\App\Bo in /opt/lampp/htdocs/magento2/vendor/magento/framework/Filesystem/Driver/File.php on line 384
Any help would be welcome
-
make sure you have an admin accessfmsthird– fmsthird2019年06月10日 09:41:57 +00:00Commented Jun 10, 2019 at 9:41
2 Answers 2
Run the command and try to refresh the page
chmod -R 777 var
rm -rf ./var/*
This error indicates that your file permissions are not correct.
You should have 777 permission to the var/ generated/ pub/ folder
if on Linux try below command. hope it helped!!
sudo chmod -R 0777 var/* generated/* pub/*