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!

SOLVED EasyApache 4 Cron Issue

Discussion in 'EasyApache' started by Josh Abbott, Mar 12, 2016.

  1. jazee

    jazee Well-Known Member

    Joined:
    Jan 12, 2015
    Messages:
    91
    Likes Received:
    1
    Trophy Points:
    8
    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?

     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,272
    Likes Received:
    2,154
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    What's the specific command you use in the cron job? Is it no longer working with EasyApache 4?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. RWH Tech

    RWH Tech Well-Known Member

    Joined:
    Oct 1, 2015
    Messages:
    86
    Likes Received:
    16
    Trophy Points:
    8
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
    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:
    [root@tempwhm ~]#  /opt/cpanel/ea-php56/root/usr/bin/php-cgi ./args.php 1 2 3 4
    Content-type: text/html; charset=UTF-8
    
    NULL
    NULL
    [root@tempwhm ~]#  /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"
    }
    [root@tempwhm ~]#
    
    


    Example of php-cli behavior:

    Code:
    args.php =
    <?php
        var_dump($argc); //number of arguments passed
        var_dump($argv); //the arguments passed
    ?>
    
    [root@tempwhm ~]# php args.php 1 2 3 4 5
    Status: 404 Not Found
    Content-type: text/html; charset=UTF-8
    
    No input file specified.
    [root@tempwhm ~]#
    [root@tempwhm ~]# php ./args.php 1 2 3 4 5
    Content-type: text/html; charset=UTF-8
    
    NULL
    NULL
    
    [root@tempwhm ~]# /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"
    }
    
    [root@tempwhm ~]#
    
     
    #23 RWH Tech, Aug 24, 2016
    Last edited: Aug 24, 2016
  4. JacobPerkins

    JacobPerkins Well-Known Member

    Joined:
    May 2, 2014
    Messages:
    619
    Likes Received:
    97
    Trophy Points:
    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?
     
  5. RWH Tech

    RWH Tech Well-Known Member

    Joined:
    Oct 1, 2015
    Messages:
    86
    Likes Received:
    16
    Trophy Points:
    8
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
    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."
     
  6. JacobPerkins

    JacobPerkins Well-Known Member

    Joined:
    May 2, 2014
    Messages:
    619
    Likes Received:
    97
    Trophy Points:
    103
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Haha, that was me :D
     
  7. RWH Tech

    RWH Tech Well-Known Member

    Joined:
    Oct 1, 2015
    Messages:
    86
    Likes Received:
    16
    Trophy Points:
    8
    Location:
    Brazil
    cPanel Access Level:
    Root Administrator
  8. Big Pixel

    Big Pixel Registered

    Joined:
    Sep 28, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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.
     
    #28 Big Pixel, Sep 28, 2016
    Last edited by a moderator: Sep 29, 2016
  9. JacobPerkins

    JacobPerkins Well-Known Member

    Joined:
    May 2, 2014
    Messages:
    619
    Likes Received:
    97
    Trophy Points:
    103
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Hi,

    What exact issues are you having with crons? Could you elaborate?
     
  10. Big Pixel

    Big Pixel Registered

    Joined:
    Sep 28, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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!
     
  11. JacobPerkins

    JacobPerkins Well-Known Member

    Joined:
    May 2, 2014
    Messages:
    619
    Likes Received:
    97
    Trophy Points:
    103
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Hi,

    Would you mind throwing in a ticket so we can take a look at this? Thanks!
     
  12. reficul

    reficul Member

    Joined:
    Dec 15, 2008
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    51
    Location:
    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.
     
  13. JacobPerkins

    JacobPerkins Well-Known Member

    Joined:
    May 2, 2014
    Messages:
    619
    Likes Received:
    97
    Trophy Points:
    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!
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice