Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

I'm trying to install php module via macports. I have them installed, so I run

cd /opt/local/apache2/modules
sudo /opt/local/apache2/bin/apxs -a -e -n "php5" 

Then I'll ensure myself, it's loaded, I see in httpd.conf:

LoadModule php5_module modules/

Then I can see file exists in modules directory. Then I restart the apache with below command: sudo /opt/local/apache2/bin/apachectl -k restart But when I send query to load modules with apachectl -M command, I can't see any php5 entry. Also, .php files aren't interpreted now, I can only see the sources.

What was my mistake?

share|improve this question

I wrote comprehensive instructions here, but the main thing is that you need to make further edits to httpd.conf to tell it how to interpret .php files and to use index.php.

The key lines are

AddHandler application/x-httpd-php .php


DirectoryIndex index.html index.php

There's a lot more at the referenced link, along with long-winded explanations of every step.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .