Jump to:

23370 Posts in 18160 Topics by 2864 members

General Questions

SilverStripe Forums » General Questions » Static Publisher Issue

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 1600 Views
  • ttyl
    Avatar
    Community Member
    114 Posts

    Static Publisher Issue Link to this post

    This is a strange problem that took me a while to properly identify and if anybody could give me some advice I'd be very grateful.

    First off I am using static publisher for caching. When I run mysite.com/dev/buildcache from the browser everything works as expected. However, I'd prefer to have it a nightly cron job. To that end I've gone through all the steps to get sake working, and it does - mostly. The odd thing that happens is any top-level pages that use images from dataobjects or other pages simply don't output images, but sub-pages do.

    For example, I have a 'news' page that has an image. my home page has a widget that pulls the newspage image. if I build the cache from the browser the images are there. if I build it from the command line they are not. if I make a second home page that is a subpage of the original home page the sub page will have the images but the home page (top level) will not when building from command line. this identical code, only difference is one is a subpage.

    anybody know what to make of this? it's really the last hurdle to finish a site and it's confounding me...

    thanks!

  • ttyl
    Avatar
    Community Member
    114 Posts

    Re: Static Publisher Issue Link to this post

    anybody? this is really killing me, final step to finish this project.

  • ttyl
    Avatar
    Community Member
    114 Posts

    Re: Static Publisher Issue Link to this post

    also, I'm using 2.4.1, php 5.2.6, mysql 5.0.77

    nothing useful in my logs

    I get this in my logs...

    [08-Oct-2010 11:12:04] Warning at sapphire/filesystem/GD.php line 392: imagejpeg(): SAFE MODE Restriction in effect. The script whose uid is 10002 is not allowed to access /var/www/vhosts/MYSITE/httpdocs/assets/_resampled/SetSize13792-lev-header.jpg owned by uid 48 (http://MYSITE/past-events)

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Static Publisher Issue Link to this post

    If opening /dev/buildcache in the browser works, why use sake at all?
    Simply create a cronjob that calls yoursite.com/dev/buildcache directly using wget, curl, or even php?

    It should be as simple as calling


    from within cronjob...

  • ttyl
    Avatar
    Community Member
    114 Posts

    Re: Static Publisher Issue Link to this post

    you have to be authenticated to do that

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Static Publisher Issue Link to this post

    I see. I guess you could even login using curl but that might be too complicated.
    Quite possibly you're running the cronjob as another user than the user php or apache runs as. That's why you get the access error.
    Did you try to set your assets folder permissions to 0777 (recursively)?

    Or maybe issue the sake calls as the "apache-user" (sometimes called www)

  • ttyl
    Avatar
    Community Member
    114 Posts

    Re: Static Publisher Issue Link to this post

    same thing when I run as apache, very weird. and sub-pages are fine btw, only top-level pages.

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Static Publisher Issue Link to this post

    Setting permission bits on the asset folder didn't help either?
    That it affects top-level pages only is indeed very weird though.

    1600 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.