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!

Cron jobs problem - headers

Discussion in 'General Discussion' started by Piotr W., Oct 6, 2016.

Tags:
  1. Piotr W.

    Piotr W. Registered

    Joined:
    Oct 6, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Poland
    cPanel Access Level:
    Root Administrator
    After recent WHM update (WHM 58.0 (build 31) - CENTOS 7.2 x86_64) my cron jobs for users accounts started to output headers like this:

    Set-Cookie: PHPSESSID=[some_data]; path=/
    Expires: Thu, 19 Nov 1981 08:52:00 GMT
    Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Pragma: no-cache
    Content-type: text/html; charset=UTF-8

    Scripts are doing their jobs but additional output generates tones of emails...

    Running task from console - no headers.
    Running task from cron job with same command (php some/path.php) - headers as shown above.

    Any ideas?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,344
    Likes Received:
    1,854
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Piotr W.

    Piotr W. Registered

    Joined:
    Oct 6, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Poland
    cPanel Access Level:
    Root Administrator
    Thank you for your reply.

    No, I'm using EasyApache 4 from the beginning of my server (recent build) - EA4 was in beta then. It all worked fine until recent WHM autoupdate.

    I've tried things from given article:

    /usr/bin/php - did not work
    /usr/local/bin/php - works good now

    The question is - what changed? Before update simple 'php' worked fine. When I'm checking version of php (php --version) it shows the same version as /usr/bin/php, /usr/local/bin/php

    Is there a way to globally fix this? Some binding maybe? I have 50+ cron jobs, it would be huge pain to edit those one by one in cpanel.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,344
    Likes Received:
    1,854
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Could you let us know which path you are using for PHP in the additional cron jobs? For instance, are they all configured to use "/usr/bin/php" instead of "/usr/local/bin/php"? If so, this command would update all instances of "/usr/bin/php" to "/usr/local/bin/php" in the cron jobs for all of your users:

    Code:
    cp -a /var/spool/cron /var/spool/cron-backup
    replace "/usr/bin/php" "/usr/local/bin/php" -- /var/spool/cron/*
    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
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