Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 16
  1. #1
    Member
    Join Date
    Dec 2010
    Posts
    14

    Default running php5 as suphp, what are my optimizer options ?

    hi all, i've read lots of conflicting information about which optimizers work with php as suphp - i have eEccelerator running but i've read that it's not actually doing anything when running php as suphp. Does anyone have first-hand experience with running an optimizer on php-suphp ? If not, then what is the best setup to use (php as dso/apc, etc) ? thank you.

  2. #2
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,300
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: running php5 as suphp, what are my optimizer options ?

    None of the OPCode will work for suPHP, so APC, XCache and EAccelerator will not work with suPHP due to how it functions.

    If you require OPCode for optimization of PHP, then you'd have to use either DSO or FCGI. Of the two options, DSO and FCGI, DSO is more well-known and easier to work with but less secure due to the fact processes run as the user nobody and you must have higher file permissions frequently for PHP scripts to run; FCGI is more secure and almost as fast as DSO, but it is harder to get a working configuration and less well-known whenever anything goes wrong and you need assistance.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  3. #3
    Member
    Join Date
    Dec 2010
    Posts
    14

    Default Re: running php5 as suphp, what are my optimizer options ?

    Thank you for your reply. In your opinion, is it worth it ? Going through the effort and switching to DS0+APC ?

  4. #4
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,300
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: running php5 as suphp, what are my optimizer options ?

    If you really need the speed up for PHP sites and the reduction in load levels for the machine in general, then it would be worth it to switch to DSO. I'd really only suggest doing this if you are good with keeping the machine up-to-date for PHP scripts and not allowing insecure options in your php.ini file. Security will be the biggest concern on switching to DSO, but you will definitely have an improvement in options for optimization and reduction in server load.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  5. #5
    Member
    Join Date
    Dec 2010
    Posts
    14

    Default Re: running php5 as suphp, what are my optimizer options ?

    thank you.

    Can you pls point me in the right direction of how to switch to DSO ? I assume this involves recompiling apache/php using EasyApache - do I just uncheck the "Mod SuPHP" option in page 5 of the wizard ?

    thanks again.

  6. #6
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,300
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: running php5 as suphp, what are my optimizer options ?

    You likely wouldn't need to recompile Apache. You can either select DSO in WHM > Apache Configuration > PHP and SuExec Configuration area or run a command similar to the following in root SSH to switch the handler for PHP5 systems:

    Code:
    /usr/local/cpanel/bin/rebuild_phpconf 5 none dso 1
    The above would set PHP 5 as the default, set no handler for PHP4 (this is what the none means), set dso for PHP5 and set SuExec to "on" state (1 is on and 0 is off).
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  7. #7
    Member
    Join Date
    Dec 2010
    Posts
    14

    Default Re: running php5 as suphp, what are my optimizer options ?

    Hi there, I had looked in the "PHP and SuExec Configuration" options page, but there is no option for DSO - I only have suphp/fcgi/cgi/none.

  8. #8
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,300
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: running php5 as suphp, what are my optimizer options ?

    That's a bit strange as DSO should always be part of the module build since there isn't a select option in EasyApache to build it. Can you try running the command I provided in root SSH and then run the following afterward:

    Code:
    /usr/local/cpanel/bin/rebuild_phpconf --current
    If you receive any errors, please note the error message.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  9. #9
    Member
    Join Date
    Dec 2010
    Posts
    14

    Default Re: running php5 as suphp, what are my optimizer options ?

    Hi there, I have a live site running on my vps so I cannot run anything now that might break the site (I know switching to DSO now would because I have custom a php.ini).

    I will open a ticket to my hosting company about that issue and get back to you here. thanks for your support.

  10. #10
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,300
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: running php5 as suphp, what are my optimizer options ?

    Certainly, please let us know how it goes.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  11. #11
    Member
    Join Date
    Mar 2011
    Posts
    7

    Default Re: running php5 as suphp, what are my optimizer options ?

    Hi
    Actually, SherifBuzz has a point about DSO dissapearing. If you compile Apache with SuPHP and FCGI options(if I remember corectly), DSO will not show up in the handler list and the only options will be: None, SuPHP, CGI, FCGI. It happened to me about 2 weeks ago when I was playing around with a VPS.

  12. #12
    Member
    Join Date
    Dec 2010
    Posts
    14

    Default Re: running php5 as suphp, what are my optimizer options ?

    I had to rebuild apache/php and remove the options mpm_event, and mpm_worker - now dso is listed as an option in the "PHP and SuExec Configuration" page.

    I did a quick switch test, and i'm getting a permissions error on /tmp :

    Warning: session_start() [function.session-start]: open(/tmp/sess_7539a1d6c5297eb8a85382e06725f70e, O_RDWR) failed: Permission denied (13) in ....

    I assume that the user 'nobody' needs permissions on this folder, and probably other folders - do you know is there some script that already exists to handle this or am i going to have to do it manually ?

    regards.

  13. #13
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,300
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: running php5 as suphp, what are my optimizer options ?

    Can you run a stat on /tmp and provide the results?

    Code:
    stat /tmp
    The user nobody doesn't need access to the folder. The folder simply needs to have the following permissions:

    Code:
    Access: (1777/drwxrwxrwt)  Uid: (    0/    root)   Gid: (    0/    root)
    To change to those:

    Code:
    chmod 1777 /tmp
    Unfortunately, there wouldn't be any script to manually correct permissions on user accounts. You would be able to check the Apache error logs at /usr/local/apache/logs/error_log to see any other accounts having an issue, though.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  14. #14
    Member
    Join Date
    Dec 2010
    Posts
    14

    Default Re: running php5 as suphp, what are my optimizer options ?

    stat /tmp returns :

    File: `/tmp'
    Size: 229376 Blocks: 456 IO Block: 4096 directory
    Device: 31h/49d Inode: 477761382 Links: 6
    Access: (1777/drwxrwxrwt) Uid: ( 0/ root) Gid: ( 0/ root)
    Access: 2010-10-23 19:51:15.000000000 -0500
    Modify: 2011-04-09 18:34:10.000000000 -0500
    Change: 2011-04-09 18:34:10.000000000 -0500
    i guess the permission problem then is actually on previously created session files (that were created when php was running as suphp) inside tmp and not tmp itself - so i guess clearing those files when switching should do the trick ?

  15. #15
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,300
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: running php5 as suphp, what are my optimizer options ?

    If you clear those files, it should help with the issue correct.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

Similar Threads & Tags
Similar threads

  1. suPHP and Zend Optimizer
    By Solokron in forum cPanel and WHM Discussions
    Replies: 10
    Last Post: 03-14-2011, 03:21 PM
  2. suphp php4+php5
    By testtubebaby in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 05-23-2008, 03:55 AM
  3. SuPHP+PHP5+Apache 2.0
    By bobin in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 01-22-2008, 06:52 PM
  4. SuPHP with PHP5 (howto)
    By flen in forum cPanel and WHM Discussions
    Replies: 36
    Last Post: 10-01-2006, 03:48 PM
  5. PHP5 extra options
    By DN-Paul in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 03-21-2005, 05:51 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube