Author - Vinai Kopp

I work for Magento Inc. as manager of developer education since October 2011. Before that I worked as a freelancer doing Magento development and developer trainings. Also, I'm the co-author of the German Magento Developer Handbook published by O'reilly.

More Info » Follow me on Twitter »

Reader Comments (123)

  1. Paul Bates
    Paul Bates
    January 8, 2012 at 12:45 am /

    This must be fate, I and Rackspace have been struggling with our cron setup for days and unable to find a solution. Looking forward to Vinai’s thoughts here! Can you run the cron directly whilst the cache is enabled? http://mysite.com/cron.php?

    Reply
    1. Colin
      January 8, 2012 at 7:41 am /

      Are you running the cron job as the same user that runs the web server? E.g.:

      sudo -u www-data crontab -e

      Reply
  2. Jerome
    Jerome
    January 9, 2012 at 1:55 am /

    Hi,

    My cron job is configured via directadmin and they works but if i use code in local.xml

    [/code]
    apc
    myprefix_
    Netzarbeiter_Cache_Model_Symlink
    [/code]

    Cron arent scheduled and dont run...

    When i deleleted the code in my local.xml... cron are scheduled and runs again

    Reply
    1. Robert Popovic
      January 9, 2012 at 3:01 pm /

      When using APC with the Apache php executable, you need to add:

      apc.enable_cli = 1
      

      to your apc.ini (or php.ini) config file.

      Reply
      1. Robert Popovic
        January 9, 2012 at 3:08 pm /

        However, looking a Colins previous comment around this flag (apc.enable_cli = 1) it seems that this is not the best thing to do. The alternative is to create a cron job that will not use the php cli executable but do a curl or wget of your cron php script, ie:
        curl -s -o /dev/null http://www.yoursite.com/absolute/path/to/magento/cron.php

        Reply
        1. Vinai Kopp
          January 9, 2012 at 8:36 pm /

          Jerome, There are several possible reasons. I agree with Colins and Roberts comments. Please check var/log/*.log for possible explanations, and that you are using the latest version of the extension, in particular that Netzarbeiter_Cache_Model_Symlink::__construct looks exactly like here: https://github.com/Vinai/Symlink-Cache/blob/master/app/code/community/Netzarbeiter/Cache/Model/Symlink.php

          Reply
  3. Paul
    January 16, 2012 at 1:24 pm /

    Just a quick update on the cron issues as it maybe of some reassurance. Opting for the curl option on the direction of our RackSpace support team this works with the original Symlink.php file and crons are now running successfully. I have now updated the Symlink.php file as encouraged by Vinai and this too is running without issue.

    Reply
    1. Jerome
      Jerome
      February 1, 2012 at 10:30 pm /

      Hi Paul,

      How and which modifications to make for the file?

      My problem is APC because if i use apc in local.xml without slow backend, my cron dont work (symlink is not actived)

      Best regards

      Reply
      1. Vinai Kopp
        February 1, 2012 at 10:41 pm /

        Severa possibilites Jerome,

        1) set apc.enable_cli = 1 in you php.in (not recommended unless your crontab runs as the apache user)
        2) use the file cache backend for the cron calls with a different cache directory (fiddly to set up)
        3) use the curl option to call the Magento cron.php script (see the previous comments for more info)

        Reply
      2. Paul
        February 1, 2012 at 10:54 pm /

        Jerome,

        As Vinai suggests in point 3). “use the curl option to call the Magento cron.php script (see the previous comments for more info)”.

        If you google “setting CRON jobs with Curl” it will provide a clearer understanding.

        I asked our support team at RackSpace to set it up (cause we’re rubbish at that sort of stuff).

        Reply
  4. Magento - Une boutique plus rapide avec Soon_AdvancedCache

    [...] Intégration de Symlink Cache En savoir plus… [...]

Add a Comment & Join the Discussion

Insert small snippets of code by using [code]{your_code_here}[/code]
For larger code blocks please use http://pastebin.com and paste your link.

You may also use the following HTML in your comment: <a href="" title=""> <abbr title="">
<acronym title=""> <blockquote cite=""> <cite> <em> <strike> <strong>