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.

EA3 compile with php-cli

Discussion in 'EasyApache' started by jimlongo, Jun 21, 2017.

  1. jimlongo

    jimlongo Well-Known Member

    Joined:
    Mar 20, 2008
    Messages:
    165
    Likes Received:
    3
    Trophy Points:
    68
    Using EasyApache3, how do I compile Apache with PHP-CLI enabled, I don't see it anywhere in the build options.

    Using Apache 2.4.25 / PHP 5.6.3

    Thanks.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You can run the following commands with EasyApache 3 to see what path to use for PHP-CLI:

    Code:
    /usr/bin/php -v
    /usr/local/bin/php -v
    Look for "CLI" in the output to see which one to use (it depends on if CGI/suPHP are enabled in your EasyApach 3 build profile).

    Thank you.
     
  3. jimlongo

    jimlongo Well-Known Member

    Joined:
    Mar 20, 2008
    Messages:
    165
    Likes Received:
    3
    Trophy Points:
    68
    Thanks Michael.
    I'm still not clear on what to do to enable cli.
    phpinfo() indicates that I'm using Server API CGI/FastCGI

    my current build configuration is
    Default PHP Version (.php files) 5
    PHP 5 Handler suphp
    Apache suEXEC on
    Apache Ruid2 off



    root@vps [~]# /usr/bin/php -v
    PHP 5.6.30 (cgi-fcgi) (built: Jun 6 2017 23:44:27)
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with XCache v3.2.0, Copyright (c) 2005-2014, by mOo
    with XCache Cacher v3.2.0, Copyright (c) 2005-2014, by mOo

    root@vps [~]# /usr/local/bin/php -v
    PHP 5.6.30 (cli) (built: Jun 6 2017 23:44:21)
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with XCache v3.2.0, Copyright (c) 2005-2014, by mOo
    with XCache Cacher v3.2.0, Copyright (c) 2005-2014, by mOo
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Could you provide some more information about how you are attempting to utilize it? Based on the output, you'd use the following path if you wanted to invoke PHP-CLI via the command line or a cron job:

    Code:
    /usr/local/bin/php
    The PHPINFO file is not going to show PHP-CLI because you are not invoking it from the command line.

    Thank you.
     
  5. jimlongo

    jimlongo Well-Known Member

    Joined:
    Mar 20, 2008
    Messages:
    165
    Likes Received:
    3
    Trophy Points:
    68
    Thanks, I got you now.
     
    cPanelMichael likes this.
  6. jimlongo

    jimlongo Well-Known Member

    Joined:
    Mar 20, 2008
    Messages:
    165
    Likes Received:
    3
    Trophy Points:
    68
    Now, how can I compile php-cli with "readline" support?
    So that I get a php> prompt and can output each command?

    When I enter php -a I get "Interactive Mode Enabled"
    I would prefer to have an Interactive Shell which is not the same as I understand it.

    Documentation says to compile php with --with-readline option.
     
    #6 jimlongo, Jun 21, 2017
    Last edited: Jun 21, 2017
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    You'd need to use the full path. EX:

    Code:
    /usr/local/bin/php -a
    You should be able to install "readline" as a PHP module in your EasyApache 3 build profile if it's not enabled by default:

    Code:
    /usr/local/bin/php -m|grep readline
    readline
    
    Thank you.
     
  8. jimlongo

    jimlongo Well-Known Member

    Joined:
    Mar 20, 2008
    Messages:
    165
    Likes Received:
    3
    Trophy Points:
    68
    This is where I'm at, there is no option to enable "readline" in EA3 build profile that I can see. Is it called something else?



    root@vps [~]# /usr/local/bin/php -m|grep readline
    root@vps [~]#
     
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Are you sure it's not installed by default? Check to see if the module name is output when running the "/usr/local/bin/php -m|grep readline" command. Also, did you try running "/usr/local/bin/php -a" to see if the issue persists when using the full path?

    Thank you.
     
Loading...

Share This Page