1

following error when installing Magento2. Can anyone offer any advice? New to Magento. Installing on CentOS box locally.

    [ERROR] exception 'Exception' with message 'Warning: mkdir(): File exists in /var/www/mydomain.com/vendor/magento/framework/Filesystem/Driver/File.php on line 219' in /var/www/mydomain.com/vendor/magento/framework/App/ErrorHandler.php:61
Stack trace:
#0 [internal function]: Magento\Framework\App\ErrorHandler->handler(2, 'mkdir(): File e...', '/var/www/mydoma...', 219, Array)
#1 /var/www/mydomain.com/vendor/magento/framework/Filesystem/Driver/File.php(219): mkdir('/var/www/mydoma...', 504)
#2 /var/www/mydomain.com/vendor/magento/framework/Filesystem/Driver/File.php(198): Magento\Framework\Filesystem\Driver\File->mkdirRecursive('/var/www/mydoma...', 504)
#3 /var/www/mydomain.com/vendor/magento/framework/Filesystem/Directory/Write.php(88): Magento\Framework\Filesystem\Driver\File->createDirectory('/var/www/mydoma...', 504)
#4 /var/www/mydomain.com/vendor/magento/framework/Filesystem/Directory/Write.php(247): Magento\Framework\Filesystem\Directory\Write->create('.')
#5 /var/www/mydomain.com/vendor/magento/framework/Filesystem/Directory/Write.php(264): Magento\Framework\Filesystem\Directory\Write->openFile('install.log', 'a+')
#6 /var/www/mydomain.com/setup/src/Magento/Setup/Model/WebLogger.php(114): Magento\Framework\Filesystem\Directory\Write->writeFile('install.log', '#8 /var/www/mydomain.com/setup/src/Magento/Setup/Model/Installer.php(327): Magento\Setup\Model\WebLogger->log('Starting Magent...')
#9 /var/www/mydomain.com/setup/src/Magento/Setup/Controller/Install.php(97): Magento\Setup\Model\Installer->install(Array)
#10 /var/www/mydomain.com/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(82): Magento\Setup\Controller\Install->startAction()
#11 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#12 /var/www/mydomain.com/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#13 /var/www/mydomain.com/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#14 /var/www/mydomain.com/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(118): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#15 /var/www/mydomain.com/vendor/zendframework/zend-mvc/src/DispatchListener.php(93): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#16 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#17 /var/www/mydomain.com/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#18 /var/www/mydomain.com/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#19 /var/www/mydomain.com/vendor/zendframework/zend-mvc/src/Application.php(314): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#20 /var/www/mydomain.com/setup/index.php(31): Zend\Mvc\Application->run()
#21 {main}
1
  • Did yo make sure that var directory is empty and writable by Magento? If you have restarted the installation for some reason, you should remove all previously generated/copied files. Magento 2 is quite picky on the permissions side. Apr 6, 2016 at 10:26

2 Answers 2

2

When you extract magento files make sure you provide the permission of that folder to read and write and after installation you have to delete all the content inside var folder.var folder is located in mgento2 root directory

1

set file/folder permission for magento 2:

find . -type d -exec chmod 770 {} \; && find . -type f -exec chmod 660 {} \; && chmod u+x bin/magento

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.