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.

KFSys
Site Moderator
Site Moderator badge
March 2, 2020
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

KFSys
Site Moderator
Site Moderator badge
March 9, 2020

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

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel