Hi all,
I have set the /wp-content/plugins/yet-another-photoblog/cache/ to 777 and everything sort-of works - the files get uploaded and the cache files get created - but, with permissions 600. My server is running suPHP and it's giving a 403 error until I manually chmod the files inside /cache/ to 644.
Any ideas?
Okay, I have solved this problem!
Edit the file /wp-content/plugins/yet-another-photoblog/lib/YapbImage.class.php.
1. Find and add the line "chmod($thumbPath, 0644);" as showed below.
PHP Code:
if ($phpthumb->GenerateThumbnail()) {
if ($phpthumb->RenderToFile($thumbPath)) {
if ($replaceOriginal) {
$result = $this->getFullHref();
} else {
$result = $this->_getUniqueThumbnailHref($phpThumbConfig);
}
//ADD THIS LINE BELOW THERE
chmod($thumbPath, 0644);
} else {
$log->error('Couldn\'t save ' . $thumbPath . ' - Please check cache directory permissions');
}
I hope this gets included in the mainstream release.
Have a nice day!
NIXin
It must be a problem specific to your configuration? All my cache files are 644 and I've done nothing to alter YAPB's behavior in that regard.
spacefish Wrote:It must be a problem specific to your configuration? All my cache files are 644 and I've done nothing to alter YAPB's behavior in that regard.
Seems to be a php configuration issue - NIXin will probably have that problem with every php application writing files... But i don't know where to configure such a behavior? Maybe under which user php runs?
Greets from Salzburg,
Johannes
Johannes Wrote:Seems to be a php configuration issue - NIXin will probably have that problem with every php application writing files... But i don't know where to configure such a behavior? Maybe under which user php runs?
Greets from Salzburg,
Johannes
The PHP runs under suPHP, so every script is executed with the user the site belongs to (better than running every site on the server as www-data). Unfortunatly the files created are 600, not 644.
And acctually, I have multiple forums, (phpBB, Invision Power Board) and other scripts that upload files -
uploaded files are with correct permissions - that is - 644. Acctually, the YAPB
uploads the files with 644 to: /wp-content/uploads/2008/04/file.jpg. The problem is with the cached files, which are created by ImageMagick, I think. Those files are 600.
My solution isn't working 100% right, the files get chmodded after the error 403 is presented, so I have to refresh the page to get the image.
Greetings form Krakow,

Bazyli
Sorry for the late response -
I really forgot about that thread while moving to my new house ...
Quote:My solution isn't working 100% right, the files get chmodded after the error 403 is presented, so I have to refresh the page to get the image.
As far as i can see it, the chmod was placed on the right location right after the thumbnail creation in YapbImage.class.php... I really don't understand why apache returns back a 403.
The workflow is the following: Your client requests the YapbThumbnailer.php which calls the transform-method of the YapbImage Class. The method checks for existance, creates a new thumbnail file, chmods it and returns the path as a result. Finally, the YapbThumbnailer redirects to returned path. Your client requests the thumbnail directly, which should have the right permission and should be accessed and served by apache without any problems.
Nevertheless, i released 1.9.9, which incorporates the chmod.
Thanks for your help and
greets from Salzburg,
Johannes
Johannes Wrote:Sorry for the late response -
I really forgot about that thread while moving to my new house ... 
No problem
Johannes Wrote:As far as i can see it, the chmod was placed on the right location right after the thumbnail creation in YapbImage.class.php... I really don't understand why apache returns back a 403.
Neither did I, fortunately I switched from apache2 to lighttpd and the problem is no more!
[though I have a small problem with the comments on lighttpd, I will post about that later - simply put: yapb doesn't use the SEO friendly engine of WordPress and error404 handler I use instead of htaccess redirects, doesn't catch info from yapb]
Johannes Wrote:Nevertheless, i released 1.9.9, which incorporates the chmod.
Great! It's best to be redundant and compatible.
Johannes Wrote:Thanks for your help and
greets from Salzburg,
Johannes
Thanks for responding and noticing the problem!
Greets from Krakow
Bazyli