Php file downloads instead of displaying nodejs serve






















I know that there are 1. So I figured that I would add the solution to my problem here. If I commented these two lines out in my. I have no idea what they do or how they got there, - but it is in every one of my. I have VirtualMin installed on an Ubuntu I upgraded to PHP version 7. I got the error that his post talks about: For every site on my VPS, it simply downloaded the index. I had a similar problem to the OP when upgrading php5 from an older version, to 5.

I'm running a LAMP setup on a machine on my local network, which I use to preview changes to websites before I upload those changes to the actual live server.

So I maintain a perfect local mirror of the actual site. After the upgrade, files which run and display perfectly on the actual site would not display, or would only display html on the local machine.

PHP was not parsed. The phpinfo command worked, so I knew php was otherwise working. The log generated no errors. Viewing the page source showed me the actual php code. This worked.

I got this kind of problem. This is how I solve it. Different type of PHP versions installed to my computer. Then I remove some PHP packages from my previous list, using apt-get purge. For people who have found this post from Google almost 6 years in the future and beyond! Another possible cause of this problem could be that you are trying to run the script in a "user directory" from the the UserDir module. Running PHP scripts in user directories is disabled by default.

You must comment or delete the tag block at the bottom that reads. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Apache is downloading php files instead of displaying them Ask Question. Asked 8 years, 3 months ago. Active 1 year ago. Viewed k times. OS and server information: CentOS 6. Thank you. EDIT: I have these lines in the php. Anthony Gainor. Anthony Gainor Anthony Gainor 1, 2 2 gold badges 9 9 silver badges 9 9 bronze badges.

Well, how did you install it? Which SAPI? Your php module is not running. I edited the questions. The modules do exits and they are being loaded apparently — Anthony Gainor.

Did you restart apache after installation? Show 6 more comments. Active Oldest Votes. Mihkel Mihkel 6 6 silver badges 2 2 bronze badges. Could you add some info where to put these lines? For people looking for where to put these lines. In my case , on Apache This works, adding d part to x-http-php like on your post works!

I've configured php from source — Liso. Add a comment. So here is another possible cause: If you have something like AddHandler x-mapp-php6. Share This Post. Share on facebook. Share on linkedin. Share on twitter. Share on email. Any domain that does not have a PHP version explicitly set uses this version. Share this: Twitter Facebook. Like this: Like Loading Subscribe To Our Newsletter.

Get updates and learn from the best. Next How to embed a video to your website Next. More To Explore. I followed this too but still no success. Same problem is persisting.

Add the following line to it, just after the line and restart the server. Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group.

Create a free Team What is Teams? Learn more. PHP file gets download instead of getting executed when browsed in any browser Ask Question. Asked 10 years, 4 months ago. Active 9 years, 7 months ago. Viewed 8k times. Improve this question. Community Bot 1. Usman Usman 2 2 gold badges 5 5 silver badges 13 13 bronze badges.



0コメント

  • 1000 / 1000