The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

suPHP and caching

Discussion in 'General Discussion' started by aegis, Jul 13, 2008.

  1. aegis

    aegis Well-Known Member

    Joined:
    Jul 6, 2003
    Messages:
    64
    Likes Received:
    0
    Trophy Points:
    6
    Has anyone got a decent php cache / accelerator setup running with suPHP also?

    I like the advantages of suPHP for security and tracking down rogue user scripts hogging cpu/ram but it comes at the price of not being able to cache using eAccelerator.
     
  2. bgr

    bgr Registered

    Joined:
    Oct 27, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    doesnt work with APC too.
    anyone knows how to use APC and suPHP together?
    thanks
     
  3. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    AFAIK, you can't, because the cache files are created by the owner process which changes for each user when running under suPHP compared to the global insecure "nobody" account when not using it.
     
  4. aegis

    aegis Well-Known Member

    Joined:
    Jul 6, 2003
    Messages:
    64
    Likes Received:
    0
    Trophy Points:
    6
    I think that's irrelevant though. Even if both /home/user1/www/script.php and /home/user2/www/script.php are the same scripts both running under nobody, they are both cached as if the two are completely different scripts. They just share the same cache area.

    The problem with the cache software seems to be more to do with PHP running as a cgi than it not being shared across every website as "nobody". It's a big pity as a cache can really improve the heavier scripts and I think if we could have a cache that ran as the user and worked with cgi then it'd help. The downside would be memory and disk usage taking a hit as each user would need their own cache.
     
  5. mm1250

    mm1250 Well-Known Member

    Joined:
    Nov 10, 2006
    Messages:
    108
    Likes Received:
    0
    Trophy Points:
    16
    How about Fast-CGI? Does that help at all?
     
  6. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    You just proved chirpy's point

    The problem is the PHP interpreter is not persistent in memory when using suPHP and CGI. Each request starts a new interpreter which stops when the request is fulfilled. This is unlike DSO where the PHP interpreter remains resident between requests.
     
  7. Gene Steinberg

    Gene Steinberg Well-Known Member

    Joined:
    May 26, 2007
    Messages:
    157
    Likes Received:
    1
    Trophy Points:
    18
    OK, what about using the eAccelerator module that's part of Easy :: Apache? Are there settings and other issues that I need to consider/avoid in doing that?

    Peace,
    Gene
     
  8. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    AFAIK, it won't have any effect on suphp.
     
  9. Gene Steinberg

    Gene Steinberg Well-Known Member

    Joined:
    May 26, 2007
    Messages:
    157
    Likes Received:
    1
    Trophy Points:
    18
    And, in turn, suPHP won't slow down acceleration either?

    Just want to be certain of all this before I make the move. :)

    Peace,
    Gene
     
  10. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    Well, no.. as the only time acceleration will enter the picture is when suPHP isn't being used. So, I think if you had a dual php4/5 setup where php4 is running as an Apache mod and php5 is running as a cgi via suphp.. those sites running under php4 will gain the benefits of the accelerator, but not those running under php5.

    That's my understanding anyways.
     
  11. Gene Steinberg

    Gene Steinberg Well-Known Member

    Joined:
    May 26, 2007
    Messages:
    157
    Likes Received:
    1
    Trophy Points:
    18
    So in this situation, if I use PHP 5 for everything, eAccelerator is useless?

    Anyone from cPanel want to suggest something, or can someone assist me in the proper Easy :: Apache configuration then?

    Keep it simple. :)

    Peace,
    Gene
     
  12. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    That's the way I understand it. I stopped using any php caching at all, when I switched to suphp. I'm not sure if fastCGI will help. I've never really found a clear answer on that.

    Ps. I should have said it's suphp and not php5 per say that makes the accelerator unusable.
     
    #12 verdon, Sep 2, 2008
    Last edited: Sep 2, 2008
  13. Gene Steinberg

    Gene Steinberg Well-Known Member

    Joined:
    May 26, 2007
    Messages:
    157
    Likes Received:
    1
    Trophy Points:
    18
    Well, since it's offered in the standard Easy :: Apache installation, surely they'd accommodate this.

    So can I get some advice here about setting up the Apache upgrade in a fashion that allows for this to function without craziness?
     
  14. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    If you want caching, you have to use the DSO (mod_php). There may be ways of doing caching with FastCGI, but that can easily have other, impractical, consequences.


    The caching extensions are displayed in the EasyApache interface because PHP DSO is always built, which is where Caching works.
     
  15. Gene Steinberg

    Gene Steinberg Well-Known Member

    Joined:
    May 26, 2007
    Messages:
    157
    Likes Received:
    1
    Trophy Points:
    18
    OK, clarify. Disable suPHP and use mod_php? Anything else in the configuration I should observe?

    Peace,
    Gene
     
Loading...

Share This Page