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(): Cannot execute using backquotes in Safe Mode (just if from commandline)

Discussion in 'General Discussion' started by yit, Feb 16, 2009.

  1. yit

    yit Registered

    Joined:
    Feb 16, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    51
    Everything was ok before a small update (apache+php), but now I get this strange problem with php as shell script.

    this is my test.php (safe_mode is off and already tried with custom php.ini)
    Code:
    #!/usr/local/bin/php -n
    <?php
    echo shell_exec("uptime");
    ?>
    
    Output:
    Warning: shell_exec(): Cannot execute using backquotes in Safe Mode in

    Code:
    Server Version: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.7a  mod_bwlimited/1.4
    
    # php -v
    PHP 5.2.8 (cli) (built: Feb 16 2009 16:18:58)
    Copyright (c) 1997-2008 The PHP Group
    Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
        with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
        with Suhosin v0.9.27, Copyright (c) 2007, by SektionEins GmbH
        with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies
    
    
    # uname -a
    Linux 2.6.9-55.0.2.ELsmp #1 SMP Tue Jun 12 17:58:20 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux
    
    cPanel 11.24.4-S33345 - WHM 11.24.2 - X 3.9
    REDHAT Enterprise 4 x86_64 on standard
    
    + suphp, mod_security, suhosin. basedir_restriction


    An other strange thing:

    I get this error when I run that script as shell:
    # /root/bin/test.php

    But it is running normal when I execute with php command:
    # php -f ./root/bin/test.php -c /root/bin/php.ini
     
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