Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

Static Publisher Issue


Go to End


12 Posts   2674 Views

Avatar
ttyl

Community Member, 114 Posts

8 October 2010 at 11:01am

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!

Avatar
ttyl

Community Member, 114 Posts

9 October 2010 at 3:03am

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

Avatar
ttyl

Community Member, 114 Posts

9 October 2010 at 3:49am

Edited: 09/10/2010 4:20am

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)

Avatar
bummzack

Community Member, 904 Posts

9 October 2010 at 4:21am

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

curl http://yoursite.com/dev/buildcache

from within cronjob...

Avatar
ttyl

Community Member, 114 Posts

9 October 2010 at 4:28am

Edited: 09/10/2010 4:29am

you have to be authenticated to do that

Avatar
bummzack

Community Member, 904 Posts

9 October 2010 at 4:38am

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)

Avatar
ttyl

Community Member, 114 Posts

9 October 2010 at 5:09am

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

Avatar
bummzack

Community Member, 904 Posts

9 October 2010 at 5:29am

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

Go to Top