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

From what I've seen in various docs and example configurations, you could have PHP-FPM set up on a different server/hardware, separate from your webserver (nginx in my case).

While most examples list some variation of this:

location ~ \.php {
    [various parameters]

You could have fastcgi_pass redirect to any IP address ( to be safe or, go crazy!), thus delegating PHP processing to a different server.

My questions are: those separate servers must have the PHP files accessible within their filesystem, right? If yes, how do I configure the root directory for PHP to find the files, given that it's something usually done in nginx's config (in my case). Is it via chroot and chdir parameters in the pool config or whatever I send as SCRIPT_FILENAME from nginx?

Now the most interesting part (for me): if having the files on that server isn't necessary (and nginx provides the file to the ip:port in fastcgi_pass), how do includes work?

I was just thinking about setting up a bunch of PHP-FPM servers and let them bear the processing load of a Wordpress Multisite node, without having to rsync tons of stuff back and forth.

share|improve this question
Yes, the files need to exist on the PHP nodes. – ceejayoz Oct 5 '13 at 16:28
up vote 1 down vote accepted

The files need to exist on the PHP backend server as well, and they have to be in the exact same path as on the webserver itself. PHP doesn't know anything about translating script file paths, so it uses the path as it is passed from the frontend server.

share|improve this answer
Anyway to get around not having the files on both on FE and BE servers? – Matt The Ninja Jun 3 at 10:26

The easiest way to do this is to place all the files in shared storage (i.e. an NFS mount), which is then mounted to the same mount point on all of the servers. Then, you do not need to do any sort of rsync or other copying.

share|improve this answer

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.