Server Fault is a question and answer site for system and network administrators. 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 installed PHP 5.3.6 on Mac OS X 10.6 , but how can I run it with Nginx instead of Apache?

Previously I used MAMP with Apache but I would like to switch to nginx.

How can I install Nginx with PHP on Mac OS X?

share|improve this question

migrated from May 21 '11 at 17:16

This question came from our site for professional and enthusiast programmers. – Rafe Kettler May 21 '11 at 17:00
@Rafe Kettler I don't really get it, the article tells me how to install it with nginx, not how to run PHP :S – CIRK May 21 '11 at 17:10
Well, hi serverfault guys! I hope you can help me :-) – Adam May 21 '11 at 17:32

The built in Apache2 with Mac OSX can run PHP by just uncommenting out this line in your httpd.conf file:

LoadModule php5_module libexec/apache2/

This won't work with Nginx

For Nginx you will have to compile it from source and configure your server files to use fastcgi.

You will also have to install php5-fpm or one of the old spawn-fcgi or php-cgi methods. The PHP 5.3.6 you installed won't work with Nginx.

I would go with php-fpm and you can get installation instructions on the wiki..

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.