Thu 28 Oct 2004 12:43:41 AM UTC, original submission:
Installing the stock FUDForum supplied with phpgw is highly problematic. The setup would fail leaving the apache log full of errors about not having permission to copy weird files. Updating from CVS did not help.
I was able to fix it correcting a few lines in the setup file (the original index.php). The idea is that there are two instances of code which read
--8<--8<--8<--8<---
$dir = opendir(PHPGW_SERVER_ROOT."/fudforum/setup/base/{$d}");
readdir($dir); readdir($dir);
while ($f = readdir($dir)) {
// do stuff
--8<--8<--8<--8<---
I noticed that this could be the problem because in the error log a lot of the files trying to be copied had several instances of .. in their path. I changed the above to
--8<--8<--8<--8<---
$dir = opendir(PHPGW_SERVER_ROOT."/fudforum/setup/base/{$d}");
while ($f = readdir($dir)) {
if ($f=="." || $f=="..") continue;
// do stuff
--8<--8<--8<--8<---
and it worked. There are two instances to correct.
It seems that the FUDForum people assume that readdir'ing twice will take them past . and .., but this assumption is dangerous at best, since the fact that the above change fixes its behaviour means that (as of PHP 4.3.8) this is not true.
I don't know if this is specific to PHPGW (I don't think so) or it's more of a fudforum issue, but I think that at least a warning should be issued to people trying to install fudforum in phpgw. Also, there are lots of double readdirs like the ones above scattered around the code in fudforum, which I think will also have to be corrected.
Maybe updating to a more recent of fudforum would help, but I have no clue on how to do that (or even if it's possible).
I'm now seriously considering correcting every opendir loop in fudforum by hand, but any help (or more elegant solution) would be appreciated.
Thank you - CP
|