1

I'm scaling a PHP application to multiple servers with a frontend webserver (running Apache) for static files and proxying dynamic requests for two application servers. My question is how do I run PHP on the application servers? From the Rails world I know application servers like Mongrel or thin which can host the application. What are the equivalents in PHP-land?

5 Answers 5

4

You should take a look at PHP-FPM. It is a PHP FastCGI implementation that should let you separate the PHP to its own application server.

1

As an extension of @cagenut's comment, I would recommend sticking with the simple case and using a reverse proxy (mod_proxy_http) under Apache to distribute load from a front-end to other servers. If you should choose to go the FastCGI route, you may wish to heed the advice toward the bottom of this post.

PHP normal practice differs from Ruby in some respects mainly mod_php is an extremely mature implementation (where Ruby seemed poorly suited for in-process embedding). There are benefits to running the PHP process out-of-band from Apache (security, isolation, control). Yet, if your purpose is to distribute load only, I would stick with the simpler implementation and wait for actual need before complicating the setup further.

1

Check out Photon - http://www.photon-project.com. Its still at its beginnings, but looks promising.

2
  • We generally prefer that you disclose your affiliation with the product.
    – Scott Pack
    Mar 1, 2011 at 21:16
  • @Scott: Well, the "product" is open source and the guy who is behind it created another open source tool I'm affiliated with. Sorry that this hasn't been made more clear.
    – tommyd
    Jun 2, 2011 at 21:34
0

You could run the applications using PHP-CLI for something simple, but PHP-FPM as suggested by carson is definitely a better option?

0

Why fight the common/simple case, run it as mod_php under apache.

2
  • I would really love to know who voted this down and why.
    – cagenut
    Feb 24, 2011 at 17:27
  • I would also like that. Feb 13, 2012 at 20:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .