We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6038
    • 228 Posts
    I've followed the instructions on the rtfm page, but I just can't seem to get cronManager to run. The cron jobs I have created in cronManager say 'cronjob not started yet'. I have a reduced the active crons to a simple script that emails me to say its working, but still no joy.

    When I ssh in and execute the script (assets/components/cronmanager/cron.php) via the command line i get the php error:
    Fatal error: Out of memory (allocated 2359296) (tried to allocate 7680 bytes) in /home/xxx/core/xpdo/xpdo.class.php on line 1924
    


    My php.ini script has 256Mb memory allowance - it should be enough!

    If I visit the URL for the cron script, I receive the following response:
    {"success":false,"code":401}

    so it looks like a permissions issue - but the file is set to 755, which should be adequate (?)

    Does anyone have an idea what might be going wrong?

    This question has been answered by christianhanvey. See the first response.

    [ed. note: christianhanvey last edited this post 14 years, 4 months ago.]
      • 6038
      • 228 Posts
      Follow up:
      The 'out of memory' issue was a furphy, a red herring, as it turns out. The '401' response was the clue.

      I had some leftover .htaccess authentication rules that were preventing the cron being accessed, but not an http request. As soon as I removed the redundant rules (which were not affecting web access) the cron was able to execute.

      Edit: actually no it did not solve it - it had only executed when I ran the script via a regular HTTP request. The cron is still failing with 401 response. Back to the drawing board.... [ed. note: christianhanvey last edited this post 14 years, 4 months ago.]
        • 1343 ☆ A M B ☆
        • 2,213 Posts
        Try 644 permission for the file.
          Patrick | Server Wrangler
          About Me: Website | Tweets |  MODX Hosting
        • discuss.answer
          • 6038
          • 228 Posts
          OK - now really solved. I actually had two issues:

          1) I have a custom generated php.ini which was in a different directory to the website. The php script executing via shell was not picking this up, so i needed to explicitly tell it which php.ini file to use. It was this that was causing my 'out of memory' issue.

          2) I needed to run the php command with the q flag (suppress http headers) which was causing the 401s

          * * * * * php -c /path/to/custom/php.ini -q /path/to/public_html/assets/components/cronmanager/cron.php

          [ed. note: christianhanvey last edited this post 14 years, 4 months ago.]