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.

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:
    30,811
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  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:
    30,811
    Likes Received:
    672
    Trophy Points:
    113
    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.
     
Loading...

Share This Page