The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    edit /usr/local/lib/php.ini
    and remove shell_exec from the disable functions line
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  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...)
     
Loading...

Share This Page