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!

Cannot execute shell_exec function

Discussion in 'General Discussion' started by Nazmul Hasan, Aug 30, 2015.

  1. Nazmul Hasan

    Nazmul Hasan Registered

    Joined:
    Aug 30, 2015
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Bangladesh
    cPanel Access Level:
    Root Administrator
    Hello,

    I have a linux server where cPanel is installed. I cannot call shell_exec function from PHP in that server. I have another server where cPanel is not installed there i can call shell_exec function.

    Can anyone please tell me what is the difference in cPanel server. What changes I need to make to execute that function using PHP.

    Thanks
     
  2. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,719
    Likes Received:
    74
    Trophy Points:
    203
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    edit /usr/local/lib/php.ini
    and remove shell_exec from the disable functions line
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,704
    Likes Received:
    1,883
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello :)

    Yes, as mentioned, check to see if it exists under the disable_functions entry in your /usr/local/lib/php.ini file.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Tobias Karlsson

    Tobias Karlsson Active Member

    Joined:
    Jul 29, 2015
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Sweden
    cPanel Access Level:
    Root Administrator
    Or you can sign in to WHM -> PHP Configuration Editor - > click on advanced mode

    Now you can easy search and delete that line.
     
  5. Fral-IT

    Fral-IT Member

    Joined:
    Jun 13, 2012
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    What if I want it for just one user, please?
     
  6. mageshm

    mageshm Well-Known Member

    Joined:
    Apr 17, 2014
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Chennai, INDIA
    cPanel Access Level:
    DataCenter Provider
    @Fral-IT,
    By default cpanel server was disable all php vulnerability functions that's why you are facing the issue. You need to remove "shell_exec" function from "disable functions" line that's it.

    You can done this by using above two methods which one is familiar for you....got it...)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

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