Php file is downloaded when Php program is run in browser

When I try to run a php program in the browser the php file is downloaded instead of executed.

Image

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.0

Should 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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like