ea-php-cli overly aggressive about -v flag?
$ cat >test.php
$ 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
-
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. 0 -
'php test.php -v' should not print anything, because the -v is intended for the script.
@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.0
Please sign in to leave a comment.
Comments
2 comments