I have complete installation&run successfully magento2 package some days ago...

But, Now I trying to run the package

index.php source code was displaying while executing the magento2 package.

i try the URL ---> It's Correctly working,


Admin side URL>Correctly working,

This URL ---> It's shown the index.php source code.

enter image description here

Please give any solution or link for solve that issue...

  • 1
    I think permission issue Commented Jun 15, 2019 at 8:24
  • Thank you @JugalKishor i try all command like(setup upgrade,static-content:deploy -f, indexer:reindex,cache:clean,And set the permission sudo chmod -R 777 ./) now solved the issue ...
    – manoji
    Commented Jun 15, 2019 at 9:10

3 Answers 3


Your apache or nginx server is not configured properly, possisble caused of this issue is 1. Incorrect permissions 2. The nginx or apache server is not configured to identify *.php files 3. Also, check mod_rewrite it may not be configured.


I solved the issue

Thorugh try all command like under root directory


sudo php bin/magento setup:upgrade

sudo php bin/magento setup:static-content:deploy -f

sudo bin/magento indexer:reindex

sudo php bin/magento cache:clean

sudo chmod -R 777 ./


solved this issue.


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

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.