Server Fault is a question and answer site for system and network administrators. 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

I recently removed MAMP as I wanted to have more control over my machine and wanted to make use of PHP5.4 I installed using the script located here I cannot now not even get my default PHP that is built in to osx to work. I am running this script with a simple In a document in my ~/Sites directory. I am really at a loss as to why this will not work. I have php5 installed in my /usr/local directory via the link provided above and it seems like the main php is installed in /usr/bin

Any and all insight on how to debug this would be greatly appreciated.

share|improve this question

migrated from Jun 2 '12 at 5:16

This question came from our site for professional and enthusiast programmers.

Sounds like Apache is not properly configured to serve PHP documents. Check /etc/apache2/httpd.conf (or wherever you've stored your Apache config file, if not using the installation that ships with OS X) and make sure you're loading the mod_php module.

For example, my config file contains these lines:

LoadModule php5_module libexec/apache2/
<IfModule php5_module>
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps
    <IfModule dir_module>
        DirectoryIndex index.html index.php

These may differ slightly based on your Apache installation. You said you "removed MAMP", but then it sounds like you're still using the Apache installation that ships with OS X.

You could try adding

AddHandler application/x-httpd-php .php

to a VirtualHost configuration block or to a .htaccess file and see if PHP works then. If so, Apache is configured properly to use PHP, you just need to associate the .php extension with the PHP interpreter.

If it doesn't work, check your error log (probably /var/log/system.log on OS X).

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.