Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 stackoverflow.com May 21 '11 at 17:16

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

    
henrik.nyh.se/2008/02/php-in-nginx-on-os-x –  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 :-) –  Ádám May 21 '11 at 17:32
add comment

1 Answer

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/libphp5.so

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
add comment

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.