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.

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 (wiki.nginx.org/NginxSimpleCGI) 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

2 Answers 2

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  
+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

 
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.