Question

Why is wordpress site download file instead displaying site?

Hi,

Recently I upgraded to Ubuntu 16.04, i struggled to restart Apache2 but finally solved, but now website is downloading instead of display, even wp-admin page also downloading.

Regards, Raja


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

Hi @rajviswas,

The download behavior happens when the server, WebService doesn’t know what to do with the file and just provides you with it to download. This usually happens when your PHP interpreter on your droplet is offline or if you have added some rule in your .htaccess file which changes the default behavior.

To test this, remove the .htaccess file of your website located in your DocumentRoot and see if the website is going to start loading, I bet it will start.

Then if you wish some help with debugging exactly which line causes this issue, post your .htaccess file here and we’ll be able to pinpoint it for you.

Regards, KDSys

Hi @rajviswas,

Thank you for the confirmation, in that case, please type in the following command to install the MySQL extension for php 7.4

sudo apt-get install php7.4-mysql

You might not have all the other extensions as well, so you’ll most probably need to install them the same way. Here is an example how to do it

sudo apt-get install -y php7.4-{bcmath,bz2,intl,gd,mbstring,mysql,zip}

Regards, KDSys