Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For some reason, PHP files display as plain text in the browser when I browse locally via MAMP PRO.

I looked through the PHP settings and there doesn't seem to be anything there that would affect this:

I ran phpinfo(); and it's showing version 5.4.10 running fine.

Any ideas?

share|improve this question
If you fixed it, put the solution in as an answer so others can realize this was fixed without reading the entire question – Canadian Luke May 5 '13 at 18:55
have you checked to see if is loaded in httpd.conf? – Trevor Rudolph May 6 '13 at 9:44
@CanadianLuke Thanks, I added the solution below. – Sam Nabi Oct 4 '13 at 14:36
up vote 1 down vote accepted

Fixed it. Turns out I had an .htaccess files in the parent directory, with the following line in it:

AddType x-mapp-php5 .php

Removed the file and now PHP executes properly. I guess I don't need to have this .htaccess file on my local machine.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.