PHP / FCGI question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ZYV
    Senior Member
    • Sep 2005
    • 315

    #1

    PHP / FCGI question

    Hello,

    This question is by no way related to Dathorn apart from that I don't know another place where I can quickly get a competent reply I am currently trying to offload a very busy CentOS 5.1 / Apache 2.2 / PHP 5.1.6 (ISAPI) webserver with dozens of Tbs of traffic per month. My plan is to switch to nginx + PHP-FCGI. I have set up nginx, then borrowed spawn-fcgi from lighty... Everything works fine so far.

    BUT, I used to have per-vhost mbstring configuration! This is necessary because PHP 5.1.6 still does not have native Unicode support. I could turn mbstring on system-wide, but that would break phpMyAdmin and other badly designed applications. So I need to turn it on only for specific subdomains.

    I see no way I can implement per-vhost mbstring configuration in my case. ini_set does not seem to work either. I know that at Dathorn (at least for PHP 4.x) PHP used to pick custom php.ini in the current folder and it worked recursively.

    Could anybody offer me a piece of advice on how to implement such configuration?
  • ZYV
    Senior Member
    • Sep 2005
    • 315

    #2
    Well, I have solved this by firing up two separate FCGI servers on different ports, one with a more generic PHP configuration, and another one with more tweaks and mbstring function overloading enabled by default. Anyway I don't feel like it's the most elegant solution of all times.

    Comment

    • ZYV
      Senior Member
      • Sep 2005
      • 315

      #3
      Huh, I'm getting more and more experienced with FCGI. It looks like PHP's native FCGI manager (at least for the 5.1.6 which is stock RPM supplied with CentOS 5.1) has a bad habit of segfaulting killing all of its child processes. For whatever reason it never restarts itself. It's very frustrating because nginx keeps reporting 504/Gateway timeout or 502/Bad gateway error all the time for everything that requires PHP. The nice thing about it that the server itself keeps serving static content at full speed.

      I've been looking for a solution for quite some time and BINGO! finally I found, compiled, installed and configured daemontools by DJB. I had to apply some patches from qmail though because otherwise it won't compile.

      Man it rocks! Now my PHP-FCGI servers are next to unstoppable

      Then some time later I found http://www.google.ru/search?q=php-fpm which looks like something very performant and promising. However you need to recompile your stuff all the time whenever PHP gets updated and it's not why we choose RHEL in the first place.

      Any opinions and firsthand personal experience are welcomed.

      Comment

      Working...