fs_copy redeclaration error with php-nuke 6.5

J-Mann

Joined: 2003-03-21
Posts: 90
Posted: Tue, 2003-04-08 18:05

Has ANYONE found a real solution to:

Fatal error: Cannot redeclare fs_exec() (previously declared in /home/perfec4/public_html/modules/Screensavers/platform/fs_unix.php:24) in /home/perfec4/public_html/modules/Screensavers/platform/fs_unix.php on line 24

I've see countless posts where this error comes up in php-nuke forums all over. The only solution I've found is for postnuke.

The reason I get this error:
I want to use ALL THREE of the blocks that are included with the "random block" package included on this site. If I use the random photo block, I get no errors. When I enable one of the others (such as the last updates block), I immediately get this error because both files use some of the same functions (I guess?). Neither file, however, directly calls upon fs_copy. So why the error with fs_copy?

If you've found a solution for this, or if you know how to fix it so that you can use all three blocks at once in php-nuke 6.5. Please post it here and I'll put together a readme file for others along with editing the code and packaging it up. Then I'll put the fixed code up for others.

Please help :wink:

J-

 
dmolavi
dmolavi's picture

Joined: 2002-12-05
Posts: 573
Posted: Tue, 2003-04-08 18:16

the only way i got this error to go away was to move it from the left side to the right side of the page.

 
J-Mann

Joined: 2003-03-21
Posts: 90
Posted: Tue, 2003-04-08 18:21

Ok, maybe I didn't explain everything good enough. The random photo block is already on the right side. I have no problems with the random photo block.

The problem is with the OTHER blocks (last updated, etc) that pull info from gallery. I want to use ALL THREE of these blocks. I only get the error when I use one of the other blocks AND the random block. Doesn't matter which side either of them is on. If two of them are enabled, this error exists.

I'm looking for a real solution here, I refuse to believe that this is an un-repairable error.

J-

 
dmolavi
dmolavi's picture

Joined: 2002-12-05
Posts: 573
Posted: Tue, 2003-04-08 18:29

the only "real" solution i could see is to make 3 copies of fs_unix.php (fs_unix.php, fs_unix2.php, fs_unix3.php) and change the references to them in each of the three blocks. unless there is some php.ini setting that can be changed, this is the only workaround that i can figure out. not sure if this will work, since i'm not using 3 blocks in the fashion you are, but give it a shot and let me know.

 
J-Mann

Joined: 2003-03-21
Posts: 90
Posted: Tue, 2003-04-08 18:35

I wish it were that simple. The real problem is in the fact that NONE of the files call on fs_unix. They just make references to functions within the file. I haven't checked init.php yet, the problem might be in there.

Thanks for the idea though.

 
dmolavi
dmolavi's picture

Joined: 2002-12-05
Posts: 573
Posted: Tue, 2003-04-08 18:39

i don't think it matters whether or not they explicitly call the function. i think that each reference to the file creates separate declarations of those functions or something, and thus if you have more that one reference to the file, you have multiple declarations of the same function in the same filenamespace. try my idea, i'm curious if it would work.

 
J-Mann

Joined: 2003-03-21
Posts: 90
Posted: Tue, 2003-04-08 20:47

Ok,

I made init.php, init2.php, init3.php...

I made fs_unix.php, fs_unix2.php, fs_unix3.php

In init2.php I point to fs_unix2.php, init3 points to fs_unix3.php

In my second block, I use init2.php, and init3.php on the third.

Without even making it to the third block. The second block gives me the exact same error with one small difference. Now the redeclare is on fs_exec() which makes absolutely no sense to me.

Anyways, it didn't work :sad:

Nice try though.

Any other ideas?

 
dmolavi
dmolavi's picture

Joined: 2002-12-05
Posts: 573
Posted: Tue, 2003-04-08 20:57

the only other thing i can think of is to look through the chain of includes to make sure that none of them require the original fs_unix.php.

 
J-Mann

Joined: 2003-03-21
Posts: 90
Posted: Tue, 2003-04-08 21:01

I just double checked... there is only one instance of fs_unix in init.php and there are ZERO instances of fs_unix in all of the blocks.

I'm stumped. I'll keep messing with it, but I have other things to do too... maybe in the meantime someone will figure this out.

 
Doctor_WHO
Doctor_WHO's picture

Joined: 2003-02-23
Posts: 26
Posted: Sat, 2003-04-12 04:04
Quote:
...The problem is with the OTHER blocks (last updated, etc) that pull info from gallery. I want to use ALL THREE of these blocks. I only get the error when I use one of the other blocks AND the random block. Doesn't matter which side either of them is on. If two of them are enabled, this error exists....

Hello, I am two months into php, learnd a lot, but not well versed at all. Anyway, I have just installed your tweak. If the block is on the left (both logged in as admin, and not), i get the fs_unix error, if it is on the right it appears to work fine (so far). I do not have any other blocks referencing Gallery - save the Gallery link in the navagation(modules) block. I guess its for the same reason you cant have more than one block calling Gllery information, cause when it's on the right it goes away when the gallery comes up.

Is there a way to make it use a specific album instead of all albums within gallery? My thumbs are too wide for the theme I am using. So I would make a album with thumbs the size that would fit in the themes block, and also only show random photos from the latest months LAN party.
Alternatively, is there a way to force all the thumbs to be say, 130pixels regardless of what they are in the Gallery? I am sure some html code in the:
<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE> $content = "<p align='center'>"
."<a href=" .($albumURL)
.">"
.$album->getThumbnailTag($index)
."</a></p>";</TD></TR></TABLE><!-- BBCode End -->
Can do it, im just too ignorant. Any help would be GREATLY appreciated.

THe site is ndgaming.net, but I do not have the Random Block visible by users since it is a active site. I would really love to have the block on the left for cosmetic reasons... so I'll be looking into this also (with my limited knowledge).

(Out of curiosity, what did the hack in the session.php file do?)