When I try to run a php program in the browser the php file is downloaded instead of executed.
1 Answer
You need to have a web server that executes the php script. PHP is a server side language.
On ubuntu this may be done with apache:
sudo apt-get install apache2 libapache2-mod-php7.0Should set you up with apache.
provides more information on how to set it up properly, including where to place the content to be served.
0