I have installed magento 2 in my ubuntu and I tried to run magento setup, it print the index.php code.
Help me.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityThere are 3 possibilities:
1. You don't have PHP installed. In that case run:
sudo apt-get install php php-mysql
2. You have PHP installed but not enabled. You can try running:
sudo a2enmod php7
sudo service apache2 restart
3. You have PHP installed and enabled but you haven't restarted apache.
sudo service apache2 restart
if you have above answer, depending on which magento 2 version you are trying to install.
for e.g. if you are going with > 2.3 you must be needing php
~7.1.3 ~7.2.0.
if that's not the case with you, then coming towards your 500 error. which usually means something is not right with the code. the possible url might not exist.
Another possible issue could be the missing modules. Try executing below (If your PHP version is 7.4)
sudo apt-get install libapache2-mod-php7.4
sudo service apache2 restart