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

What is the best way to run PHP with Nginx?

  1. Run Nginx with PHP FastCGI
  2. Run Nginx as a reverse proxy while Nginx forwards request to Apache
share|improve this question
It should read FastCGI instead of CGI. nginx supports CGI only through a hack ( at this time. – joschi Jun 25 '10 at 16:23
Yeah should have told PHP FastCGI Updated; Thanks! – infynyxx Jun 25 '10 at 20:10
up vote 6 down vote accepted

If you need support for htaccess or any other Apache features, option 2, otherwise option 1.

share|improve this answer

I would say option one, and look into using php-fpm with nginx, it works great.

share|improve this answer
+1 A helpful tutorial on the subject can be found on HowToForge - Installing PHP 5.3, Nginx And PHP-fpm On Ubuntu/Debian – wimvds Jul 8 '10 at 12:40

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.