Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

shell exec

Discussion in 'General Discussion' started by Zion Ahead, Mar 23, 2007.

  1. Zion Ahead

    Zion Ahead Well-Known Member

    Nov 10, 2006
    Likes Received:
    Trophy Points:
    How do I enable shell_exec in an .htaccess file for one particular account, even thought it is disabled globally in php.ini ?

    I am using php 4.4.6 / cpanel / centos

    Also, what would the .htaccess look like for php5x?
  2. xerophyte

    xerophyte Well-Known Member

    Mar 16, 2003
    Likes Received:
    Trophy Points:
    I don't think you can do it, the docs says

    This directive allows you to disable certain functions for security reasons. It takes on a comma-delimited list of function names. disable_functions is not affected by Safe Mode.

    This directive must be set in php.ini For example, you cannot set this in httpd.conf.

    if you can not put in the httpd.conf, you can not have it in the .htaccess. Beside if you can do it what is the purpose of having the disable_functions

    hope that heslp
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. bmcpanel

    bmcpanel Well-Known Member

    Jun 1, 2002
    Likes Received:
    Trophy Points:
    Not sure if you are willing to use phpsuexec, but you can accomplish your task if you do use phpsuexec.

    If you do use phpsuexec, limit out shell_exec for everyone in the server-wide php.ini...
    disable_functions = "exec,system,passthru,readfile,shell_exec,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,dl,popen,parse_ini_file,show_source,curl_exec"

    Then, place a custom php.ini file into the directory of the account you wish to enable shell_exec ( /home/username/www/php.ini ). The custom php.ini file must be in each directory that will require the custom php.ini settings, they are not inherited by sub-directories.. Then, make sure that the custom php.ini file with the line....

    disable_functions = 'whatever,here'

    .... does not contain the shell_exec function.

    If you're not running phpsuexec, then I have no idea.
    #3 bmcpanel, Mar 24, 2007
    Last edited: Mar 24, 2007

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice