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.

php exec() problems

Discussion in 'General Discussion' started by Phillis, May 4, 2008.

  1. Phillis

    Phillis Member

    Joined:
    Oct 31, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    i am having this problem for 2 days and didn`t found an answer to it yet.
    here is my bit of code
    Code:
    <?php
    echo '<pre>';
    echo exec('whoami') or die("It doesn't work");
    echo '</pre>';
    ?> 
    when i try to run this page(test2.php) from web i get
    It doesn't work
    i tried with other commands but still nothing.
    how to fix it please..
     
  2. bornonline

    bornonline Well-Known Member

    Joined:
    Nov 19, 2004
    Messages:
    139
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Earth
    is that PHP function (exec) disabled in PHP.ini disable_functions = ?
     
  3. Phillis

    Phillis Member

    Joined:
    Oct 31, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    no its not disabled :(
     
  4. anton_latvia

    anton_latvia Well-Known Member
    PartnerNOC

    Joined:
    May 11, 2004
    Messages:
    348
    Likes Received:
    3
    Trophy Points:
    18
    Location:
    Latvia
    cPanel Access Level:
    Root Administrator
    Are you sure it's not disabled? Well, check out that "/usr/bin/whoami" is not disabled and that safe mode has not been enabled as well.

    Anton.
     
  5. Phillis

    Phillis Member

    Joined:
    Oct 31, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    i forgot to post..its been fixed
    aparently it was enabled in Plesk
    thanks for the replyes guys
     
Loading...

Share This Page