O'Reilly logo

Nginx HTTP Server by Clement Nedelcu

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

PHP with Nginx

We are now going to configure PHP to work together with Nginx via FastCGI. There are some very particular steps involved in the design of such a setup; the most bothersome being that you, most likely, cannot utilize your current build of PHP. This issue, among others, will be addressed throughout this section.

Architecture

Before starting the setup process, it's important to understand the way PHP will interact with Nginx. We have established that FastCGI is a communication protocol running through sockets, which implies that there is a client and a server. The client is obviously Nginx; as for the server, well, the answer is actually more complicated than just PHP.

By default, PHP supports the FastCGI protocol. The PHP binary processes ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required