4

I try to install magento 2.3 in windows 7, i am getting error like,

<span class="text-info">Starting Magento installation:</span><br><span class="text-info">File permissions check...</span><br><span class="hidden">[Progress: 1 / 849]</span><br><span class="text-info">Required extensions check...</span><br><span class="hidden">[Progress: 2 / 849]</span><br><span class="text-info">Enabling Maintenance Mode...</span><br><span class="hidden">[Progress: 3 / 849]</span><br><span class="text-info">Installing deployment configuration...</span><br><span class="hidden">[Progress: 4 / 849]</span><br><span class="text-info">Installing database schema:</span><br><span class="text-danger">[ERROR] RuntimeException: The path "C:/wamp/www/abc/generated/code/Magento/Directory/Helper/Data/Proxy.php.2984" cannot be renamed into "C:/wamp/www/abc/generated/code/Magento/Directory/Helper/Data/Proxy.php" Warning!rename(C:/wamp/www/abc/generated/code/Magento/Directory/Helper/Data/Proxy.php.2984,C:/wamp/www/abc/generated/code/Magento/Directory/Helper/Data/Proxy.php): The process cannot access the file because it is being used by another process. (code: 32)
Class Magento\Directory\Helper\Data\Proxy 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. in C:\wamp\www\abc\vendor\magento\framework\Code\Generator.php:135
Stack trace:
#0 C:\wamp\www\abc\vendor\magento\framework\Code\Generator\Autoloader.php(35): Magento\Framework\Code\Generator->generateClass('Magento\\Directo...')
#1 [internal function]: Magento\Framework\Code\Generator\Autoloader->load('Magento\\Directo...')
#2 [internal function]: spl_autoload_call('Magento\\Directo...')
#3 C:\wamp\www\abc\vendor\magento\framework\ObjectManager\Relations\Runtime.php(38): class_exists('Magento\\Directo...')
#4 C:\wamp\www\abc\vendor\magento\framework\Interception\Config\Config.php(166): Magento\Framework\ObjectManager\Relations\Runtime->has('Magento\\Directo...')
#5 C:\wamp\www\abc\vendor\magento\framework\Interception\Config\Config.php(160): Magento\Framework\Interception\Config\Config->_inheritInterception('Magento\\Directo...')
#6 C:\wamp\www\abc\vendor\magento\framework\Interception\Config\Config.php(189): Magento\Framework\Interception\Config\Config->_inheritInterception('DirectoryHelper...')
#7 C:\wamp\www\abc\vendor\magento\framework\Interception\Config\Config.php(140): Magento\Framework\Interception\Config\Config->hasPlugins('DirectoryHelper...')
#8 C:\wamp\www\abc\vendor\magento\framework\Interception\Config\Config.php(116): Magento\Framework\Interception\Config\Config->initialize(Array)
#9 C:\wamp\www\abc\vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php(116): Magento\Framework\Interception\Config\Config->__construct(Object(Magento\Framework\ObjectManager\Config\Reader\Dom\Proxy), Object(Magento\Framework\Config\Scope), Object(Magento\Framework\App\Cache\Type\Config), Object(Magento\Framework\ObjectManager\Relations\Runtime), Object(Magento\Framework\Interception\ObjectManager\Config\Developer), Object(Magento\Framework\ObjectManager\Definition\Runtime), 'interception', NULL)
#10 C:\wamp\www\abc\vendor\magento\framework\ObjectManager\Factory\Dynamic\Developer.php(66): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array)
#11 C:\wamp\www\abc\vendor\magento\framework\ObjectManager\ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...')
#12 C:\wamp\www\abc\vendor\magento\framework\App\ObjectManager\Environment\Developer.php(84): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...')
#13 C:\wamp\www\abc\vendor\magento\framework\App\ObjectManagerFactory.php(188): Magento\Framework\App\ObjectManager\Environment\Developer->configureObjectManager(Object(Magento\Framework\Interception\ObjectManager\Config\Developer), Array)
#14 C:\wamp\www\abc\setup\src\Magento\Setup\Model\ObjectManagerProvider.php(62): Magento\Framework\App\ObjectManagerFactory->create(Array)
#15 C:\wamp\www\abc\setup\src\Magento\Setup\Model\Installer.php(820): Magento\Setup\Model\ObjectManagerProvider->get()
#16 [internal function]: Magento\Setup\Model\Installer->installSchema(Array)
#17 C:\wamp\www\abc\setup\src\Magento\Setup\Model\Installer.php(367): call_user_func_array(Array, Array)
#18 C:\wamp\www\abc\setup\src\Magento\Setup\Controller\Install.php(109): Magento\Setup\Model\Installer->install(Array)
#19 C:\wamp\www\abc\vendor\zendframework\zend-mvc\src\Controller\AbstractActionController.php(84): Magento\Setup\Controller\Install->startAction()
#20 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#21 C:\wamp\www\abc\vendor\zendframework\zend-eventmanager\src\EventManager.php(490): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#22 C:\wamp\www\abc\vendor\zendframework\zend-eventmanager\src\EventManager.php(260): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#23 C:\wamp\www\abc\vendor\zendframework\zend-mvc\src\Controller\AbstractController.php(118): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#24 C:\wamp\www\abc\vendor\zendframework\zend-mvc\src\DispatchListener.php(118): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#25 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#26 C:\wamp\www\abc\vendor\zendframework\zend-eventmanager\src\EventManager.php(490): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#27 C:\wamp\www\abc\vendor\zendframework\zend-eventmanager\src\EventManager.php(260): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#28 C:\wamp\www\abc\vendor\zendframework\zend-mvc\src\Application.php(340): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#29 C:\wamp\www\abc\setup\index.php(39): Zend\Mvc\Application->run()
#30 {main}<span><br>

Screenshot : enter image description here

How to solve this error?

12
  • Hey, Can you go to the var/ folder inside the Magento_Root and delete .maintenance.flag file and try again. And by the way what is the PHP version you are using ? Dec 21, 2018 at 11:58
  • got any solution ? Dec 25, 2018 at 17:16
  • Because if you remove the var/* and generated/* it will fix he issue and the re run the setup:di:compile Dec 25, 2018 at 17:18
  • Try above solution and let me know if you still facing the issue. Dec 25, 2018 at 17:18
  • paste output of php -v.
    – anonymous
    Dec 26, 2018 at 4:55

3 Answers 3

2

Give write permission to the generated folder.

If in windows right click the generated folder and remove the read-only flag.

or if in linux.

Go the magento root folder and run this command.

sudo chmod -R 777 generated/

Hope this helps.

2
+25

Set up one owner for default or developer mode

In default or developer mode, the following directories must be writable by the user:

  • vendor
  • app/etc
  • pub/static
  • var
  • Any other static resources
  • generated/code
  • generated/metadata
  • var/view_preprocessed

Set up one owner for production mode

When you’re ready to deploy your site to production, you should remove write access from files in the following directories for improved security:

  • vendor
  • app/etc
  • pub/static
  • var
  • Any other static resources
  • generated/code
  • generated/metadata
  • var/view_preprocessed

Make code files and directories read-only

  • Enter the following command to change to production mode

php bin/magento deploy:mode:set production
  • Enter the following command

find app/code var vendor pub/static app/etc generated/code generated/metadata var/view_preprocessed \( -type f -or -type d \) -exec chmod u-w {} + && chmod o-rwx app/etc/env.php && chmod u+x bin/magento
  • Enter the following command as a user with root privileges

find app/code lib pub/static app/etc generated/code generated/metadata var/view_preprocessed \( -type d -or -type f \) -exec chmod g-w {} + && chmod o-rwx app/etc/env.php

Make code files and directories writable

find app/code lib var generated vendor pub/static pub/media app/etc \( -type d -or -type f \) -exec chmod g+w {} + && chmod o+rwx app/etc/env.php

Reference

2
0

ok, it seems clear the issue is permissions related.

Now, on windows, you may have some hurdles that could be simply resolved on linux.

I found the article https://mage2.pro/t/topic/4734/8 being close to your issue.

I would attempt to find the way to:

  1. find the user for your webserver running
  2. ensure the user you found is owner of the folder generated and apply this change recursively
  3. restart your webserver

Your Answer

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

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