0

There are a lot of solutions for this but they never describe how to do it. Like how to do this:

AddType application/x-httpd-php5 .php

I don't know what people mean by this and if it works or not. Is this a valid solution or does anyone have other solutions?

Thomasttw
  • 67
  • 2
  • 9
  • That behavior is prevented for security/copyright reasons. One does not want others downloading their PHP code over HTTP in a browser. – khaverim Mar 05 '17 at 21:09
  • I feel the question is unclear and as to how you're trying to access a `.php` file. Are you using `http://localhost` or as `file:///`? Have a look at http://stackoverflow.com/q/18422140/1415724 and http://stackoverflow.com/q/17024272/1415724 to start with. – Funk Forty Niner Mar 05 '17 at 21:16
  • Is PHP installed on the server? `sudo apt-get install php5` on Debian, Ubuntu, etc. – Ray O'Donnell Mar 05 '17 at 21:17
  • As for the question, that line goes into the Apache config-file, usually httpd.conf. Seriosuly, though, this is like 101 LAMP-setup, and there are hundreds, if not thousands of setup-guides out there. – junkfoodjunkie Mar 05 '17 at 21:20
  • I have a lamp server but I don't know where to add the line and how – Thomasttw Mar 05 '17 at 21:30

0 Answers0