jazee

Well-Known Member
Jan 12, 2015
128
7
68
cPanel Access Level
Root Administrator
This thread isn't the easiest to clearly understand. Is the jist of this issue that after converting to EasyApache 4, the php-cli binary is missing?

I have a cron event that runs php-cli. a 'find / -name php-cli' indicates it is now nowhere to be found on the system. However looking at my EasyApache 4 profile, it shows that php-cli modules are enabled.

So I downloaded the rpm per instructions below but php-cli is still missing. I am guessing there is an additional step to installing php-cli that cPJacob did not include?

Hi Josh,

Here's a link to an RPM that you can download and install, and then test out. I put this on my personal website for easy access. Simply install the RPM, and you should be able to start testing your crons immediately.

yum install php-cli results in 'no package php-cli available'

Let me know how it goes! Thank you!

Code:
rpm -Uvh http://houstondad.com/ea-php-cli-0.0.6-4.5.1.cpanel.x86_64.rpm
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,245
463
I have a cron event that runs php-cli. a 'find / -name php-cli' indicates it is now nowhere to be found on the system. However looking at my EasyApache 4 profile, it shows that php-cli modules are enabled.
What's the specific command you use in the cron job? Is it no longer working with EasyApache 4?

Thank you.
 

RWH Tech

Well-Known Member
Oct 1, 2015
86
16
8
Brazil
cPanel Access Level
Root Administrator
Hi Josh,

Here's a link to an RPM that you can download and install, and then test out. I put this on my personal website for easy access. Simply install the RPM, and you should be able to start testing your crons immediately.

Let me know how it goes! Thank you!

Code:
rpm -Uvh http://houstondad.com/ea-php-cli-0.0.6-4.5.1.cpanel.x86_64.rpm
There's an issue with this package that breaks CLI arguments and requires absolute paths for files. This breaks cron tasks in all kinds of fun ways AND isn't fixed by reverting to 6-4.4.2.cpanel. Good times.

EDIT: looks like the issue is related to php-cgi
Code:
[[email protected] ~]#  /opt/cpanel/ea-php56/root/usr/bin/php-cgi ./args.php 1 2 3 4
Content-type: text/html; charset=UTF-8

NULL
NULL
[[email protected] ~]#  /opt/cpanel/ea-php56/root/usr/bin/php ./args.php 1 2 3 4
int(5)
array(5) {
  [0]=>
  string(10) "./args.php"
  [1]=>
  string(1) "1"
  [2]=>
  string(1) "2"
  [3]=>
  string(1) "3"
  [4]=>
  string(1) "4"
}
[[email protected] ~]#


Example of php-cli behavior:

Code:
args.php =
<?php
    var_dump($argc); //number of arguments passed
    var_dump($argv); //the arguments passed
?>

[[email protected] ~]# php args.php 1 2 3 4 5
Status: 404 Not Found
Content-type: text/html; charset=UTF-8

No input file specified.
[[email protected] ~]#
[[email protected] ~]# php ./args.php 1 2 3 4 5
Content-type: text/html; charset=UTF-8

NULL
NULL

[[email protected] ~]# /opt/cpanel/ea-php56/root/usr/bin/php args.php 1 2 3 4 5
int(6)
array(6) {
  [0]=>
  string(8) "args.php"
  [1]=>
  string(1) "1"
  [2]=>
  string(1) "2"
  [3]=>
  string(1) "3"
  [4]=>
  string(1) "4"
  [5]=>
  string(1) "5"
}

[[email protected] ~]#
 
Last edited:

JacobPerkins

Well-Known Member
May 2, 2014
617
97
103
cPanel Access Level
DataCenter Provider
Twitter
Hi,

What is your include_path with this? That would cause these absolute paths to not be found properly. That's what we're seeing internally when we're testing this patch. Could you verify for me please?
 

RWH Tech

Well-Known Member
Oct 1, 2015
86
16
8
Brazil
cPanel Access Level
Root Administrator
Hi,

What is your include_path with this? That would cause these absolute paths to not be found properly. That's what we're seeing internally when we're testing this patch. Could you verify for me please?
Was busy hammering things out in github and we got things straightened out.
Basically "/usr/local/bin/php will link to php-cli while /usr/bin/php will link to php-cgi"

Updating to php-cgi instead of using cli causing whole lot of issues · Issue #1 · CpanelInc/php-cli · GitHub

"It's not too hard to have our RPM spit out another binary in a new place. We've opened case EA-5106 to get this done, and I hope that we can have it complete, tested and pushed out next Tuesday."
 

Big Pixel

Registered
Sep 28, 2016
2
0
1
US
cPanel Access Level
Reseller Owner
Has there been any update on this? We're currently running WHM 58.0 (build 31) and we are having an issue with the cron jobs on with EasyApache 4
I've read thru this thread and tried to install the RPM: rpm -Uvh http://domain.com/ea-php-cli-0.0.6-4.5.1.cpanel.x86_64.rpm
and got the notice
package ea-php-cli-0.1.0-2.2.1.cpanel.x86_64 (which is newer than ea-php-cli-0.0.6-4.5.1.cpanel.x86_64) is already installed.
But we're still having the issue with the cron not working.
 
Last edited by a moderator:

Big Pixel

Registered
Sep 28, 2016
2
0
1
US
cPanel Access Level
Reseller Owner
Sure, they stopped running after upgrading to easyapache 4 with under php5.6
I've tried several different methods to call the function and they are all failing. Before the upgrade to 4 the first job ran fine.
/usr/local/bin/php -f /home/machineparts/public_html/cron.php >> /home/machineparts/public_html/var/log/cron.log 2>&1 Edit
/opt/cpanel/ea-php56/root/usr/bin/php -f /home/machineparts/public_html/cron.php >> /home/machineparts/public_html/var/log/cron.log 2>&1

Here's a list of the packages currently installed

  • ea-apache24
  • ea-apache24-config
  • ea-apache24-config-runtime
  • ea-apache24-mod_bwlimited
  • ea-apache24-mod_cgi
  • ea-apache24-mod_deflate
  • ea-apache24-mod_expires
  • ea-apache24-mod_headers
  • ea-apache24-mod_mpm_prefork
  • ea-apache24-mod_proxy
  • ea-apache24-mod_proxy_fcgi
  • ea-apache24-mod_proxy_http
  • ea-apache24-mod_ruid2
  • ea-apache24-mod_security2
  • ea-apache24-mod_ssl
  • ea-apache24-mod_unique_id
  • ea-apache24-tools
  • ea-apr
  • ea-apr-util
  • ea-cpanel-tools
  • ea-documentroot
  • ea-libmcrypt
  • ea-php-cli
  • ea-php55
  • ea-php55-libc-client
  • ea-php55-pear
  • ea-php55-php-bcmath
  • ea-php55-php-calendar
  • ea-php55-php-cli
  • ea-php55-php-common
  • ea-php55-php-curl
  • ea-php55-php-devel
  • ea-php55-php-fpm
  • ea-php55-php-ftp
  • ea-php55-php-gd
  • ea-php55-php-iconv
  • ea-php55-php-imap
  • ea-php55-php-mcrypt
  • ea-php55-php-mysqlnd
  • ea-php55-php-pdo
  • ea-php55-php-posix
  • ea-php55-php-soap
  • ea-php55-php-sockets
  • ea-php55-php-xml
  • ea-php55-php-zendguard
  • ea-php55-runtime
  • ea-php56
  • ea-php56-libc-client
  • ea-php56-pear
  • ea-php56-php-bcmath
  • ea-php56-php-calendar
  • ea-php56-php-cli
  • ea-php56-php-common
  • ea-php56-php-curl
  • ea-php56-php-devel
  • ea-php56-php-fpm
  • ea-php56-php-ftp
  • ea-php56-php-gd
  • ea-php56-php-iconv
  • ea-php56-php-imap
  • ea-php56-php-ioncube
  • ea-php56-php-mbstring
  • ea-php56-php-mcrypt
  • ea-php56-php-mysqlnd
  • ea-php56-php-pdo
  • ea-php56-php-posix
  • ea-php56-php-soap
  • ea-php56-php-sockets
  • ea-php56-php-xml
  • ea-php56-php-zendguard
  • ea-php56-runtime
  • ea-php70
  • ea-php70-libc-client
  • ea-php70-pear
  • ea-php70-php
  • ea-php70-php-bcmath
  • ea-php70-php-calendar
  • ea-php70-php-cli
  • ea-php70-php-common
  • ea-php70-php-curl
  • ea-php70-php-devel
  • ea-php70-php-fpm
  • ea-php70-php-ftp
  • ea-php70-php-gd
  • ea-php70-php-iconv
  • ea-php70-php-imap
  • ea-php70-php-mcrypt
  • ea-php70-php-mysqlnd
  • ea-php70-php-opcache
  • ea-php70-php-pdo
  • ea-php70-php-posix
  • ea-php70-php-soap
  • ea-php70-php-sockets
  • ea-php70-php-xml
  • ea-php70-runtime
  • ea-profiles-cpanel
Thanks for the assist!
 

reficul

Member
Dec 15, 2008
19
0
51
Italy
cPanel Access Level
Root Administrator
I'm a bit confused...
What command should I use?? (cpanel 60 - build 15)

I've now:

Code:
/opt/cpanel/ea-php55/root/usr/bin/php -d /home/user/public_html/folder/script.php
and doesn't works.
 

JacobPerkins

Well-Known Member
May 2, 2014
617
97
103
cPanel Access Level
DataCenter Provider
Twitter
Hi,

We've fixed this a while back. You can now call '/usr/local/bin/php' if you need the php-cli binary, and '/usr/bin/php' if you need the CGI variant.

If you call 'php' only via the CRON, you're going to end up using the CGI binary, since '/usr/bin' comes first in the CRON $PATH.

I hope this helps!