| Author |
Message |
darkknight
Guru


Joined: Aug 21, 2003 Posts: 54
|
Posted: Mon Aug 25, 2003 1:09 pm Post subject: NG random block, permissions error |
|
|
Quote: › Warning: fopen("/block-random.cache", "w") - Permission denied in /home/anton/public_html/fullgallery/platform/fs_unix.php on line 53
Has anyone seen this before?
FYI:
Quote: ›
%ls -l block-random.cache
-rw-r--r-- 1 apache apache 515 Aug 25 18:17 block-random.cache
N.B. It only happens when looking at the gallery module, not the rest of the site.
Last edited by darkknight on Mon Aug 25, 2003 1:13 pm; edited 1 time in total |
|
| Back to top |
|
|
AdBot
|
| Post subject: NG random block, permissions error |
|
|
|
|
|
| Back to top |
|
 |
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
|
Posted: Mon Aug 25, 2003 1:12 pm Post subject: |
|
|
2 options:
in the random_support.php file, change this:
Code: ›
// Check the cache file to see if it's up to date
$rebuild = 1;
if (fs_file_exists(CACHE_FILE)) {
$stat = fs_stat(CACHE_FILE);
$mtime = $stat[9];
if (time() - $mtime < CACHE_EXPIRED) {
$rebuild = 1;
}
}
to this:
Code: ›
// Check the cache file to see if it's up to date
$rebuild = 0;
if (fs_file_exists(CACHE_FILE)) {
$stat = fs_stat(CACHE_FILE);
$mtime = $stat[9];
if (time() - $mtime < CACHE_EXPIRED) {
$rebuild = 1;
}
}
or, delete the cache file and let it get regenerated. |
|
| Back to top |
|
|
darkknight
Guru


Joined: Aug 21, 2003 Posts: 54
|
Posted: Mon Aug 25, 2003 1:21 pm Post subject: |
|
|
Strangely enough it was set to 0
Setting it to 1 gives:
Quote: ›
Warning: fopen("/block-random.cache", "r") - No such file or directory in /home/anton/public_html/fullgallery/platform/fs_unix.php on line 53
Warning: Invalid argument supplied for foreach() in /home/anton/public_html/fullgallery/random_support.php on line 221
and even if it rebiulds the cache file i still get the same error. (i know the second error above is already solved somewhere in the forums, so ill sort that out later) |
|
| Back to top |
|
|
darkknight
Guru


Joined: Aug 21, 2003 Posts: 54
|
Posted: Mon Aug 25, 2003 1:28 pm Post subject: |
|
|
Actually, the second error is a new one i think... line 222 of my randum_support is
Code: ›
$total = 0;
foreach ($cache as $name => $count) {
if (!$choose) {
$choose = $name;
}
$total += $count;
if ($total != 0 && ($total == 1 || rand(1, $total) <= $count)) {
$choose = $name;
}
}
|
|
| Back to top |
|
|
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Mon Aug 25, 2003 1:30 pm Post subject: |
|
|
| Check your paths. Seems like you've installed GALLERY outside NUKE? |
|
| Back to top |
|
|
darkknight
Guru


Joined: Aug 21, 2003 Posts: 54
|
Posted: Mon Aug 25, 2003 1:32 pm Post subject: |
|
|
yes, is this a problem?
gallery was installed first... so it was easier to leave it there and then link it in as a module.
It does rebuild the block.random-cache, so its got the right path for that... |
|
| Back to top |
|
|
darkknight
Guru


Joined: Aug 21, 2003 Posts: 54
|
Posted: Mon Aug 25, 2003 1:35 pm Post subject: |
|
|
actually, another observation is that when $rebuild = 1; the random block just says "no photo chosen" but only when not in the gallery module.
Its obviously a path issue, with being in the gallery path. All paths are given absolute, and straight to me gallery dir.
im looking for any path references that may want to be relative to the NUKE dir. pointers? |
|
| Back to top |
|
|
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Mon Aug 25, 2003 1:38 pm Post subject: |
|
|
| Can we see the URL and config paths from the two files? (random_support.php, block-NG-random.php) |
|
| Back to top |
|
|
darkknight
Guru


Joined: Aug 21, 2003 Posts: 54
|
Posted: Mon Aug 25, 2003 1:40 pm Post subject: |
|
|
block-NG-random.php:
Code: ›
$GALLERY_BASEDIR = "/home/anton/public_html/fullgallery/";
define(ALBUM_BASEADDR, "http://piatek.kicks-ass.net/~anton/fullalbums/");
define(SERVER_ADDR, "http://piatek.kicks-ass.net/");
require_once($GALLERY_BASEDIR . "init.php");
require_once($GALLERY_BASEDIR . "random_support.php");
random_support.php:
Code: ›
$GALLERY_BASEDIR = "/home/anton/public_html/fullgallery/";
require_once($GALLERY_BASEDIR . "init.php");
|
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
|
Posted: Mon Aug 25, 2003 1:44 pm Post subject: |
|
|
| add ~anton/ to the end of your SERVER ADDR |
|
| Back to top |
|
|
darkknight
Guru


Joined: Aug 21, 2003 Posts: 54
|
Posted: Mon Aug 25, 2003 1:51 pm Post subject: |
|
|
No change,
the phpnuke path is /
the gallery path is /~anton/fullgallery/
the album path is /~anton/fullalbum/
im not sure that change is going to help... |
|
| Back to top |
|
|
darkknight
Guru


Joined: Aug 21, 2003 Posts: 54
|
Posted: Mon Aug 25, 2003 1:54 pm Post subject: |
|
|
| some debug work reveals it is trying to open /block.random-cache... not ~anton/public_html/fullalbums/block.random-cache |
|
| Back to top |
|
|
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Mon Aug 25, 2003 1:57 pm Post subject: |
|
|
You need to move the GALLERY app in to the MODULES folder inside NUKE. If not you will have to re-code as the links from the random block are looking for it inside the modules folder.
Also the current RANDOM block you have is using the name Antons_Photos - NOT what you have configured in your config (fullgallery) |
|
| Back to top |
|
|
darkknight
Guru


Joined: Aug 21, 2003 Posts: 54
|
Posted: Mon Aug 25, 2003 1:57 pm Post subject: |
|
|
changing in random_support:
Code: ›
define(CACHE_FILE, $gallery->app->albumDir . "/block-random.cache");
To
Code: ›
define(CACHE_FILE, "/home/anton/public_html/fullalbums/block-random.cache");
solves it, so why isnt $gallery->app->albumDir the same as /home/anton/public_html/fullalbums |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
|
Posted: Mon Aug 25, 2003 1:58 pm Post subject: |
|
|
| $gallery->app->albumDir is stored in the config.php file in your gallery directory. it's value is whatever you entered in upon your first config of gallery. |
|
| Back to top |
|
|
|
|
|
|
|