jimlongo

Well-Known Member
Mar 20, 2008
242
20
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,205
363
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.
 

jimlongo

Well-Known Member
Mar 20, 2008
242
20
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



[email protected] [~]# /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

[email protected] [~]# /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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,205
363
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.
 

jimlongo

Well-Known Member
Mar 20, 2008
242
20
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.
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,205
363
When I enter php -a I get "Interactive Mode Enabled"
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.
 

jimlongo

Well-Known Member
Mar 20, 2008
242
20
68
You should be able to install "readline" as a PHP module in your EasyApache 3 build profile if it's not enabled by default:
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?



[email protected] [~]# /usr/local/bin/php -m|grep readline
[email protected] [~]#
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,205
363
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.