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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

ea-php-cli overly aggressive about -v flag?

Discussion in 'CloudLinux' started by Drandon Boss, Mar 29, 2018.

  1. Drandon Boss

    Drandon Boss Registered

    Joined:
    Mar 29, 2018
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    earth
    cPanel Access Level:
    Reseller Owner
    Code:
    $ cat >test.php
    <?php exit(); ?>
    $ php -v test.php
    ea-php-cli Copyright 2017 cPanel, Inc.
    PHP 7.0.28 (cli) (built: Mar 19 2018 10:02:43) ( NTS )
    Copyright (c) 1997-2017 The PHP Group
    Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
        with Zend OPcache v7.0.28, Copyright (c) 1999-2017, by Zend Technologies
    $ php test.php -v
    ea-php-cli Copyright 2017 cPanel, Inc.
    
    'php test.php -v' should not print anything, because the -v is intended for the script.

    I'm on CPanel 68.0.27
     
    #1 Drandon Boss, Mar 29, 2018
    Last edited by a moderator: Mar 29, 2018
  2. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,596
    Likes Received:
    60
    Trophy Points:
    328
    cPanel Access Level:
    Root Administrator
    This likely has to do with cPanel's modified /usr/local/bin/php to determine what version of PHP your account is using.

    Try running the script with the direct PHP binary for the respective PHP version:

    /opt/cpanel/ea-php70/root/usr/bin/php test.php -v

    I think that will work.

    Don't know of a solution (or if there is one) to using the /usr/local/bin/php binary.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,734
    Likes Received:
    1,706
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    @Drandon Boss,

    Have you looked into the PHP getopt function? There are some examples of how to use it at:

    PHP: getopt - Manual

    Thank you.
     
Loading...
Similar Threads - overly aggressive flag
  1. Erel
    Replies:
    11
    Views:
    278

Share This Page