Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: To phpsuexec or not to phpsuexec?

  1. #1
    Member
    Join Date
    Nov 2004
    Posts
    69

    Default To phpsuexec or not to phpsuexec?

    Hi all. I've done some research and am aware of all the benefits of it and am interested in changing to it, mainly so I know which user is running a PHP script. What I'm not aware of is any potential problems.

    I keep finding threads on forums where a few users will cite all the good things about it, and eventually someone(s) will come along and say how it's the worst coding invention ever and cites problems and everything it breaks, and then some people will debunk what he says and other will validate it.

    Can anyone tell me any potential problems that I might run into using phpsuexec and CGI PHP instead of running mod_php?

  2. #2
    Member
    Join Date
    Oct 2003
    Posts
    328
    cPanel/WHM Access Level

    DataCenter Provider

    Default

    A couple of downsides:

    1) If you have users on this server already, they're going to have scripts "break" since 777 permissions are not permitted (755 is max) and no PHP values can be put in .htaccess (php.ini must be used instead).
    2) Slower and more load intensive PHP

  3. #3
    Member
    Join Date
    Jan 2005
    Posts
    1,880

    Default

    With phpsuexec enabled, PHP scripts must obey the same sets of conditions that apply to other CGI scripts. With this in mind, you shouldn't encounter any problems.

    The golden rules to which you must adhere are:

    1. Ensure script permissions are correct
    Any script that is world-writable (i.e. permissions with XXX7) will not execute. Neither will they execute from a directory that has such permissions.

    The maximum workable permissions are 0755 for both directories and scripts.

    2. Ensure ownership of files is correct.
    Directories (not including the public_html directory) and files must be owned by user:user not nobody:nobody. In general most scripts would be already owned by user:user, however files created by PHP may have different ownership.

    3. Ensure scripts are uploaded in ASCII not binary mode
    They may become corrupt during upload and hence fail to work. This should only affect incorrectly uploaded scripts after the changeover.

    You will encounter an HTTP 500 (Internal server error) due to not following these rules.

    Try checking for and changing the permissions and ownership of existing scripts and directories beforehand and make your users aware of those three rules well before you make the changes.

    Everything should then go smoothly.

  4. #4
    Member
    Join Date
    Nov 2004
    Posts
    69

    Default

    Aric1

    #1: Do people usually chmod their php scripts to 777? I've never done it and I don't think any of my users have done it, and none of them use php values in .htaccess, so I should be OK there.

    #2: I've heard the slowdown is barely noticeable and it takes the load off of Apache so if a bad script is running, Apache is still able to serve up pages 'cause it isn't bogged down by the bad script. Is this true?
    Last edited by nothsa; 11-18-2005 at 03:15 PM. Reason: directing question to specific user

  5. #5
    Member
    Join Date
    Nov 2004
    Posts
    69

    Default

    webignition

    Quote Originally Posted by webignition
    1. Ensure script permissions are correct
    Any script that is world-writable (i.e. permissions with XXX7) will not execute. Neither will they execute from a directory that has such permissions.
    Hmmm... My users might have some scripts in world-writable directories. Thanks for the heads-up.

    Quote Originally Posted by webignition
    3. Ensure scripts are uploaded in ASCII not binary mode
    They may become corrupt during upload and hence fail to work. This should only affect incorrectly uploaded scripts after the changeover.
    Also good to know. Thanks for the info =)

  6. #6
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,496

    Default

    Most of those issues are easily overcome (permissions). There are some things that are unavaoidable:

    1. The issue Aric1 mentioned about local .htaccess and php.ini files

    2. HTTP_AUTH will no longer function. It doesn't work when running php as a CGI

    Personally, I always switch on phpsuexec on all my web hosting servers. For the few downsides I believe the security benefits far outweigh them.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  7. #7
    Member
    Join Date
    Nov 2004
    Posts
    69

    Default

    Thanks chirpy.

    I don't think that there is anything here that I can't overcome, and the benefits for me seem to outweigh any potential problems.

    I'll be setting this up later tonight =)

  8. #8
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Dec 2003
    Location
    Athens/GREECE
    Posts
    193
    cPanel/WHM Access Level

    DataCenter Provider

    Default

    Quote Originally Posted by nothsa
    Thanks chirpy.

    I don't think that there is anything here that I can't overcome, and the benefits for me seem to outweigh any potential problems.

    I'll be setting this up later tonight =)
    Good evening from Greece,

    Did u set it up? How did it go?
    Sincerely,

    George Vardikos
    HyperHosting Internet Services

  9. #9
    Member This forum account has been confirmed by cPanel staff to represent a vendor. Radio_Head's Avatar
    Join Date
    Feb 2002
    Posts
    2,075

    Default

    safe mode on for me it's much better than phpsuexec or suphp
    Stop SPAM & VIRUS :: ASSP Deluxe for cPanel http://www.grscripts.com
    █ ASSP Deluxe is supported by Fritz Borgstedt,ASSP main developer.

  10. #10
    Member hostmedic's Avatar
    Join Date
    Apr 2003
    Location
    Washington Court House, Ohio, United States
    Posts
    559
    cPanel/WHM Access Level

    DataCenter Provider

    Post safeMode - I agree

    we have many servers - each w/ their own configuration here -

    the main thing we have noticed is there are many applications that just go nuts with phpsuexec implemented

    it is for this reason we move some clients from 1 server to another server ...


    typo3 for example hates phpsuexec - few work arounds - but it still hates phpsuexec...



    Feel like your Cloud Provider's just weathering the storm? Hop Off the Cloud - The Weathers nicer over here.

  11. #11
    Member
    Join Date
    Jul 2005
    Posts
    10

    Default Please clarify

    About Chirpy's comment:

    HTTP_AUTH will no longer function. It doesn't work when running php as a CGI
    We have dozens of php pages that use

    $PHP_AUTH_USER and $PHP_AUTH_PASSWORD

    for authentication. Are these going to break with phpsuexec?


    One customer also also runs the provided phpbb, which is important for them. Any concerns there?

    TIA for your help.

    Bruce

  12. #12
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,496

    Default

    AFAIK, yes, they will break.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  13. #13
    Member
    Join Date
    Jul 2005
    Posts
    12

    Thumbs down

    yeah... phpsuexec is something I want to avoid if possible. I know one host I use is about to implememnt it. On the host I admin, im gonna try to avoid it because it is simply too limiting.

  14. #14
    cPanel Partner NOC cPanel Partner NOC Badge AndyReed's Avatar
    Join Date
    May 2004
    Location
    Minneapolis, MN
    Posts
    2,223

    Default

    Regarding HTTP-Authentication, since phpsuexe is installed on your server, all .htaccess php calls to apache are void therefore force type etc. lines in the .htaccess are useless. This is because php is no longer running as an apache module and apache will not handle those directives any longer.
    Andy Reed
    CCNA, RHCE, and Ubuntu Technologist
    ServerTune.com

  15. #15
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,496

    Default

    Well, most of the directives that you have in a local .htaccess can simply be moved to a local php.ini

    There is a workaround for the HTTP_AUTH directive "issue":

    http://www.personalsitessupport.org/...?t=1022&p=4820

    More listed under:

    http://uk.php.net/features.http-auth
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

Page 1 of 2 12 LastLast

Similar Threads

  1. phpsuexec
    By kuwaitnt in forum New User Questions
    Replies: 2
    Last Post: 05-17-2006, 09:26 AM
  2. PHPsuexec
    By superwarp7 in forum Discusión en Español
    Replies: 5
    Last Post: 04-19-2006, 10:43 PM
  3. phpsuexec
    By latpanel in forum cPanel & WHM Discussions
    Replies: 3
    Last Post: 07-19-2004, 06:43 PM
  4. Still 'nobody' after phpsuexec
    By Doctor in forum cPanel & WHM Discussions
    Replies: 2
    Last Post: 12-21-2003, 02:45 PM
  5. phpsuexec
    By jbix9 in forum cPanel & WHM Discussions
    Replies: 6
    Last Post: 10-15-2003, 03:52 AM