How to display magento site or setup page instead of showing the directory. I have shared screenshot

1k Views Asked by At

enter image description here

I am quite new to php and magento development. I am using apache2 as web server. I have installed the magento 2 in magf directory of var/www/html when I entered http://localhost/magf/ in the browser , its showing the directory not the site or installation page. Spend many hours and followed tutorials but no solution until now.

1

There are 1 best solutions below

2
Sbrandollo On

Since Magento 2.3.6 the setup wizard has been deprecated as per Magento documentation so you won't have the installation page if you are using a newer version.

With the new version of Magento the only way to install it is via CLI

Example:

$ bin/magento setup:install --base-url=http://localhost/magf/pub/ \
--db-host=localhost --db-name=magento --db-user=magento --db-password=magento \
--admin-firstname=Magento --admin-lastname=User [email protected] \
--admin-user=admin --admin-password=admin123 --language=en_US \
--currency=USD --timezone=America/Chicago --use-rewrites=1 \
--search-engine=elasticsearch7 --elasticsearch-host=es-host.example.com \
--elasticsearch-port=9200

Once your application is installed, with your current apache configuration, you should be able to see the site going to the pub/ folder.

Note: Since Magento 2.4 you also need to have elasticsearch somehow installed on your hosting setup.