Browser downloading PHP files instead of executing them. Webmin + NGinx
up vote
2
down vote
favorite
The Problem
I attempted to upgrade from PHP 7.0 to 7.2 today and it resulted in websites on the server downloading through the browser instead of executing like normal.
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get purge php7.0 php7.0-common
sudo apt-get install php7.2-curl php7.2-xml php7.2-zip php7.2-gd php7.2-mysql php7.2-mbstring
My Question
Can anyone provide me some examples of how to debug this? And any additional insight as to what may be going on?
My Theory
Technically I don't know what caused this, but my experience tells me it's one line, in one file, coming from NGinx that needs edited.
What I've Tried
I found this issue to be commonly reported here on SO. But the solutions have lacked critical information such as the file path, or the file paths they reference don't exist on my system, or the proposed solution doesn't resolve the issue.
Many articles mentioned configurations for PHP FPM and / or FastCGI. But I'm unable to identify how to confirm whether or not these are installed / running and what a proper configuration looks like for a standard web server.
What Helped
I did update my /etc/nginx/nginx.conf file from default_type application/octet-stream;
to default_type text/html;
and this has stopped the downloading of files but results in a blank page. Including my phpinfo.php
My Environment
- AWS EC2 Small
- Ubuntu 18.04
- NGinx 1.10.3
- Webmin
- Virtualmin
php nginx php-7.2 webmin virtualmin
|
show 4 more comments
up vote
2
down vote
favorite
The Problem
I attempted to upgrade from PHP 7.0 to 7.2 today and it resulted in websites on the server downloading through the browser instead of executing like normal.
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get purge php7.0 php7.0-common
sudo apt-get install php7.2-curl php7.2-xml php7.2-zip php7.2-gd php7.2-mysql php7.2-mbstring
My Question
Can anyone provide me some examples of how to debug this? And any additional insight as to what may be going on?
My Theory
Technically I don't know what caused this, but my experience tells me it's one line, in one file, coming from NGinx that needs edited.
What I've Tried
I found this issue to be commonly reported here on SO. But the solutions have lacked critical information such as the file path, or the file paths they reference don't exist on my system, or the proposed solution doesn't resolve the issue.
Many articles mentioned configurations for PHP FPM and / or FastCGI. But I'm unable to identify how to confirm whether or not these are installed / running and what a proper configuration looks like for a standard web server.
What Helped
I did update my /etc/nginx/nginx.conf file from default_type application/octet-stream;
to default_type text/html;
and this has stopped the downloading of files but results in a blank page. Including my phpinfo.php
My Environment
- AWS EC2 Small
- Ubuntu 18.04
- NGinx 1.10.3
- Webmin
- Virtualmin
php nginx php-7.2 webmin virtualmin
I got the same problem a few times in an apache envirement. I don't know alot about nginx thought but check the vhost file and also your htaccess. Most of the time thats where the problem is.
– Patrick Simard
Nov 20 at 0:23
Thanks but only Apache uses .htaccess and I'm running NGinx which uses a global and site specific nginx.conf file.
– Spencer Hill
Nov 20 at 0:25
Could you elaborate on what you mean by checking my vhosts file?
– Spencer Hill
Nov 20 at 0:25
try this: stackoverflow.com/questions/25591040/…
– Patrick Simard
Nov 20 at 0:27
1
Sorry bro. Try posting your question at serverfault.com instead. stackoverflow is more suited for programing questions then server problems.
– Patrick Simard
Nov 20 at 0:56
|
show 4 more comments
up vote
2
down vote
favorite
up vote
2
down vote
favorite
The Problem
I attempted to upgrade from PHP 7.0 to 7.2 today and it resulted in websites on the server downloading through the browser instead of executing like normal.
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get purge php7.0 php7.0-common
sudo apt-get install php7.2-curl php7.2-xml php7.2-zip php7.2-gd php7.2-mysql php7.2-mbstring
My Question
Can anyone provide me some examples of how to debug this? And any additional insight as to what may be going on?
My Theory
Technically I don't know what caused this, but my experience tells me it's one line, in one file, coming from NGinx that needs edited.
What I've Tried
I found this issue to be commonly reported here on SO. But the solutions have lacked critical information such as the file path, or the file paths they reference don't exist on my system, or the proposed solution doesn't resolve the issue.
Many articles mentioned configurations for PHP FPM and / or FastCGI. But I'm unable to identify how to confirm whether or not these are installed / running and what a proper configuration looks like for a standard web server.
What Helped
I did update my /etc/nginx/nginx.conf file from default_type application/octet-stream;
to default_type text/html;
and this has stopped the downloading of files but results in a blank page. Including my phpinfo.php
My Environment
- AWS EC2 Small
- Ubuntu 18.04
- NGinx 1.10.3
- Webmin
- Virtualmin
php nginx php-7.2 webmin virtualmin
The Problem
I attempted to upgrade from PHP 7.0 to 7.2 today and it resulted in websites on the server downloading through the browser instead of executing like normal.
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get purge php7.0 php7.0-common
sudo apt-get install php7.2-curl php7.2-xml php7.2-zip php7.2-gd php7.2-mysql php7.2-mbstring
My Question
Can anyone provide me some examples of how to debug this? And any additional insight as to what may be going on?
My Theory
Technically I don't know what caused this, but my experience tells me it's one line, in one file, coming from NGinx that needs edited.
What I've Tried
I found this issue to be commonly reported here on SO. But the solutions have lacked critical information such as the file path, or the file paths they reference don't exist on my system, or the proposed solution doesn't resolve the issue.
Many articles mentioned configurations for PHP FPM and / or FastCGI. But I'm unable to identify how to confirm whether or not these are installed / running and what a proper configuration looks like for a standard web server.
What Helped
I did update my /etc/nginx/nginx.conf file from default_type application/octet-stream;
to default_type text/html;
and this has stopped the downloading of files but results in a blank page. Including my phpinfo.php
My Environment
- AWS EC2 Small
- Ubuntu 18.04
- NGinx 1.10.3
- Webmin
- Virtualmin
php nginx php-7.2 webmin virtualmin
php nginx php-7.2 webmin virtualmin
edited Nov 20 at 0:21
asked Nov 20 at 0:13
Spencer Hill
316421
316421
I got the same problem a few times in an apache envirement. I don't know alot about nginx thought but check the vhost file and also your htaccess. Most of the time thats where the problem is.
– Patrick Simard
Nov 20 at 0:23
Thanks but only Apache uses .htaccess and I'm running NGinx which uses a global and site specific nginx.conf file.
– Spencer Hill
Nov 20 at 0:25
Could you elaborate on what you mean by checking my vhosts file?
– Spencer Hill
Nov 20 at 0:25
try this: stackoverflow.com/questions/25591040/…
– Patrick Simard
Nov 20 at 0:27
1
Sorry bro. Try posting your question at serverfault.com instead. stackoverflow is more suited for programing questions then server problems.
– Patrick Simard
Nov 20 at 0:56
|
show 4 more comments
I got the same problem a few times in an apache envirement. I don't know alot about nginx thought but check the vhost file and also your htaccess. Most of the time thats where the problem is.
– Patrick Simard
Nov 20 at 0:23
Thanks but only Apache uses .htaccess and I'm running NGinx which uses a global and site specific nginx.conf file.
– Spencer Hill
Nov 20 at 0:25
Could you elaborate on what you mean by checking my vhosts file?
– Spencer Hill
Nov 20 at 0:25
try this: stackoverflow.com/questions/25591040/…
– Patrick Simard
Nov 20 at 0:27
1
Sorry bro. Try posting your question at serverfault.com instead. stackoverflow is more suited for programing questions then server problems.
– Patrick Simard
Nov 20 at 0:56
I got the same problem a few times in an apache envirement. I don't know alot about nginx thought but check the vhost file and also your htaccess. Most of the time thats where the problem is.
– Patrick Simard
Nov 20 at 0:23
I got the same problem a few times in an apache envirement. I don't know alot about nginx thought but check the vhost file and also your htaccess. Most of the time thats where the problem is.
– Patrick Simard
Nov 20 at 0:23
Thanks but only Apache uses .htaccess and I'm running NGinx which uses a global and site specific nginx.conf file.
– Spencer Hill
Nov 20 at 0:25
Thanks but only Apache uses .htaccess and I'm running NGinx which uses a global and site specific nginx.conf file.
– Spencer Hill
Nov 20 at 0:25
Could you elaborate on what you mean by checking my vhosts file?
– Spencer Hill
Nov 20 at 0:25
Could you elaborate on what you mean by checking my vhosts file?
– Spencer Hill
Nov 20 at 0:25
try this: stackoverflow.com/questions/25591040/…
– Patrick Simard
Nov 20 at 0:27
try this: stackoverflow.com/questions/25591040/…
– Patrick Simard
Nov 20 at 0:27
1
1
Sorry bro. Try posting your question at serverfault.com instead. stackoverflow is more suited for programing questions then server problems.
– Patrick Simard
Nov 20 at 0:56
Sorry bro. Try posting your question at serverfault.com instead. stackoverflow is more suited for programing questions then server problems.
– Patrick Simard
Nov 20 at 0:56
|
show 4 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53384442%2fbrowser-downloading-php-files-instead-of-executing-them-webmin-nginx%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I got the same problem a few times in an apache envirement. I don't know alot about nginx thought but check the vhost file and also your htaccess. Most of the time thats where the problem is.
– Patrick Simard
Nov 20 at 0:23
Thanks but only Apache uses .htaccess and I'm running NGinx which uses a global and site specific nginx.conf file.
– Spencer Hill
Nov 20 at 0:25
Could you elaborate on what you mean by checking my vhosts file?
– Spencer Hill
Nov 20 at 0:25
try this: stackoverflow.com/questions/25591040/…
– Patrick Simard
Nov 20 at 0:27
1
Sorry bro. Try posting your question at serverfault.com instead. stackoverflow is more suited for programing questions then server problems.
– Patrick Simard
Nov 20 at 0:56