Local WordPress with WAMP downloads files out of Nowhere

So I’ve come to a conclusion after doing a couple of tests in my local environment. It appears whenever I go (literally just click) to the page to edit permalinks in the admin area, the .htaccess file changes it’s contents. I couldn’t figure out why exactly this happens because I couldn’t invest a whole lot of time in this issue. I wanted to change the settings of the permalinks because my post images weren’t being displayed on the website. Ultimately, just don’t go to the edit permalinks page on your local env and save a copy of your .htaccess file right after installation in case you run into this problem.

Edit

I found what the problem is finally. Whenever I go into the admin panel and change the settings or click on settings the .htaccess file adds this line at the beginning of the file:

AddHandler application/x-httpd-php70 .php

I just deleted the line and everything works fine now. It seems like the directive(AddHandler) can be used to change the version of PHP the web server uses to compile your files. More on this here