Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.


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" mod_php54.so 

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

LoadModule php5_module modules/mod_php54.so

Then I can see php54.so 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

1 Answer 1

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

and

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

Your Answer

 
discard

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.