Skip to main content

Understanding suExec, permissions, and the account php runs under

Comments

6 comments

  • cPanelMichael
    [quote="ladydi711, post: 1469342">I am using suExec, so I understood that php runs under the user account name.
    suPHP is the PHP handler you should use to ensure PHP runs as the account username. This is not the same thing as "suExec". Thank you.
    0
  • ladydi711
    Thanks for the clarification! I just reviewed my EasyApache profile, and I do indeed have suPHP/mod_suphp enabled. What else can I do to verify this setup? Thanks, Diane
    0
  • HostingH
    To check your current PHP configuration please use following command /usr/local/cpanel/bin/rebuild_phpconf --current To enable SuPHP, simply execute the following command: # /usr/local/cpanel/bin/rebuild_phpconf 5 none suphp 1
    0
  • cPanelMichael
    Check to ensure suPHP is configured as your default handler for PHP in: "WHM Home " Service Configuration " Configure PHP and suEXEC" Thank you.
    0
  • ladydi711
    Thanks again for the info. I remember now. I changed from suPHP to dso after the migration to this server, as there were some sites using php directives in the .htaccess file. At the time, that seemed the quickest way to get the sites up and running. I may re-think that now, and plan for a migration back to suPHP, but at least I understand now! Thanks again! Diane
    0
  • quizknows
    SuPHP is definitely easier for servers with multiple sites, as PHP runs as the user, and it avoids permissions issues. If you need to change PHP settings for a single site, rather than change them in .htaccess (as you did with DSO but discovered does not work with SuPHP) you can simply give the user thier own php.ini file and change their settings in that file. Simply create /home/username/public_html/php.ini (you can copy /usr/local/lib/php.ini to that location), and add this to the users main .htaccess file in public_html: suPHP_ConfigPath /home/username/public_html order allow,deny deny from all
    0

Please sign in to leave a comment.