I am trying to install Magento 2.2.4 on windows localhost using XAMPP.

My XAMPP is installed I C:\xampp7.1

To use command line I using Command prompt in C:\xampp7.1\php>

And the following command:

php C:\xampp7.1\htdocs\Magento2_2_4\bin\magento setup:install --db-host=localhost --db-name=magento224 --db-user=root --db-password=root --base-url= --backend-frontname=admin --admin-firstname=admin --admin-lastname=admin --admin-email=admin@email.com --admin-user=admin --admin-password=admin@123

But it always giving error: Can't create directory

C:/xampp7.1/htdocs/Magento2_2_4/generated/code/Magento/Framework/App/Config/ConfigSourceAggregated/. in [Magento\Framework\App\Config\ConfigSourceAggregated\Proxy]

I have given Magentonto root directory permission 777 using Cygwin

Please guide me in setting proper permissions to Magento's root directory and its ownership on windows localhost

  • You can struggle of course with all stuff you'll face with using windows. But the best solution is vagrant or Docker. So if you ask for guide - then my first step of guide for you is - use linux. Magento2 doesn't support windows. May 20 '18 at 10:05
  • As which user are you running the php /bin/magento command? I also agree with @StepanFurman - switch over to a real linux environment using vagrant or docker. Not much works very well under windows =( May 21 '18 at 11:46
  • As administrator May 21 '18 at 11:47
  • 1
    @Cyclonecode What's the difference if permissions - 777? May 21 '18 at 12:16
  • I think there was some issue when using chmod 777 Magento224 because I haven't been able to edit or delete any files after this. So I have just deleted whole magento folder and re extracted it. It is now working fine.. I am never ever going to use chmod 777 with cygwin in windows. May 21 '18 at 18:59

Remove generated folder and try again.

  • This should really be a comment, your answer that is =) May 21 '18 at 11:45
  • this worked for me along with setting the permission to magento root, pub and static folder on windows takeown /F C:\xampp\htdocs\magento223
    – Ankur Jain
    Apr 20 '20 at 6:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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