I am trying to install magento 2.4 on my local machine. When i try to access through url it shows directory structure https://prnt.sc/1jbghbf . I found that index.php is missing in the root directory. What can be done for this? Please help me with the installation.

3 Answers 3


What has happened is, they have implemented the "route everything through pub folder for security" approach.

You can find the file there.

Now Magneto Change the Structure, and website root folder is now "Pub" directory.

  • SO what i have to do to make it work?
    – Nafsss
    Aug 5, 2021 at 6:06
  • You need to modify some configuration. Kindly check this one : devdocs.magento.com/guides/v2.4/install-gde/tutorials/… Aug 5, 2021 at 6:10
  • If my answer help you into the current question, please upvote and accept as solution, so it will help other into community as well. Aug 5, 2021 at 6:38
  • I am getting this error during command line installtion Class Magento\Config\Model\Config\StructureFactory does not exist
    – Nafsss
    Aug 5, 2021 at 6:57
  • If you have different question ask separately, so other community member can also help you into that one. Aug 5, 2021 at 6:59

I had the same problem as yours, my method was simply to copy the index.php file from the pub folder to the outside, then edit the following line in the index.php file.

require __DIR__ . '/../app/bootstrap.php';


require __DIR__ . '/app/bootstrap.php';

Just point your document root to /pub folder. You will find index.php there

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.