I am trying to execute a simple php file called tester:
<!DOCTYPE html>
<body>
<?php 
echo '<p>Hello World</p>'
?>
</body>
However, whenever I activate the localhost, the file is downloaded onto my computer instead of executed. I do not know why this is. I have PHP version 5.6.30. I am running Apache on XAMPP as an administrator. My htaccess file has just this single line: AddType application/x-httpd-php .php.
Things that I tried and did not work:
- I tried uninstalling and reinstalling XAMPP
- I tried changing  AddType application/x-httpd-php .phptoAddType application/x-httpd-php5 .phpandAddHandler application/x-httpd-php52 .phprespectively
- I tried moving the htaccessfile from the root of the folder into the views, where the html is, as seen below: Before:
folder
  |----views
  |      |
  |    main.html       
.htacces  
After:
folder
  |
  |-views
       |
     main.html
     .htaccess           
How can I solve this problem?
 
     
    