Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

local PHP file is downloading instead of opening in browser

First let me state that I am NOT running a web server.

I am running on Windows 7 64-bit. When I open a php file the browser is downloading it instead of showing it as text. I am using Notepad++ to "Launch in Chrome" and it shows up in the address bar correctly but is downloading to my download directory. Just a couple of days ago this was working fine and displaying the text of the php file.

I know you need a web server with PHP installed to get the file to render correctly but that is not what I'm trying to do. I simply want it to display the php file as text. Then I change the file:/// portion of the URL to localhost and it works.

like image 875
Trippy Avatar asked Jun 04 '13 21:06

Trippy


1 Answers

That's because php is unlike html a server based programming language, it cannot be run on the computer without a server, and i assume you don't know what I am talking about, but here is how you should do it: -

  1. Download Xamp or Wamp from the internet: - here is a link for you:- http://xampp.en.softonic.com/
  2. Follow this video in order to install it : - http://www.youtube.com/watch?v=Ev9RAsvFfoc
  3. Follow this video in order to start running php files through the installed XAMP: - http://www.youtube.com/watch?v=ImZEwrHohRg
like image 200
Shady Manaa Avatar answered Oct 13 '22 22:10

Shady Manaa