Best way to use PHP with nginx?

Nuno Magalhães nunomagalhaes at
Fri Nov 13 18:19:37 MSK 2009

On Fri, Nov 13, 2009 at 14:43, John Moore <grails at> wrote:
> He says "There are dozens of HOWTOs for configuring nginx to direct .php
> files requests to FastCGI, but only a few covering the topic of running the
> PHP FastCGI backend. None of them covers the correct way, though. Let me
> show you how to get it right…PHP CGI binary is perfectly able running a
> FastCGI interface by itself. There is no need to run it with an external
> wrapper. No need to install anything more than the PHP itself."
> I suppose I should really have named the topic "Best way to use PHP with
> nginx under Ubuntu" because that's what I'm most interested in.

PHP does come as CLI and/or CGI. Ubuntu is Debian-based, so you'll
most likely just need the php-cgi package (or similar) and a boot
script to start it up, which will probably be included and placed
under /etc/init.d

()  ascii-rubanda kampajno - kontraŭ html-a retpoŝto
/\  ascii ribbon campaign - against html e-mail

More information about the nginx mailing list