Topic: Unable to install PunBB 1.3

Hi, I'm new to punBB, first I thanks punBB team.
I'm trying to install punBB 1.3 on my website, but I'm getting some errors.

When open the install script :

Warning: Invalid argument supplied for foreach() in /mnt/102/sda/5/3/mywebsite/forums/include/functions.php on line 974

But If I continue by filling all details and when I click on the "Start Install" button then I get this message :

Notice: Undefined index: Invalid language in /mnt/102/sda/5/3/mywebsite/forums/admin/install.php on line 437

An error was encountered

Please help me to complete this fresh installation if punBB 1.3, Thanks.

2 (edited by User33 2008-11-11 16:47)

Re: Unable to install PunBB 1.3

There's something wrong with your language packs. Try installing PunBB from a fresh download (no language packs).

Edit: @devs: I think it's a problem with the glob() function.

Re: Unable to install PunBB 1.3

Hi,Garciat thanks for your reply.
Actualy I downloaded it from the website and I didn't add any language packs.
btw your edit says problem with global() function, but I dont get it roll
Thanks.

4 (edited by User33 2008-11-11 18:01)

Re: Unable to install PunBB 1.3

It's actually glob(), not global()...
anyways, try replacing Lines 974-976 on 'include/functions.php':

    foreach (glob(FORUM_ROOT.'lang/*') as $dirname)
        if (is_dir($dirname) && file_exists($dirname.'/common.php'))
            $languages[] = basename($dirname);

With:

    if($handle = opendir(FORUM_ROOT.'lang'))
    {
        while (false !== ($dirname = readdir($handle)))
        {
            $dirname =  FORUM_ROOT.'lang/'.$dirname;
            if (is_dir($dirname) && file_exists($dirname.'/common.php'))
                $languages[] = basename($dirname);
        }
        closedir($handle);
    }

5 (edited by SkyLine 2008-11-11 18:03)

Re: Unable to install PunBB 1.3

hi again, I'm sorry for that mistake roll
Installation worked fine after replacing with your code big_smile
I finally got a fresh forum smile
Thank you very much Garciat wink , I really appreciate your help.
thanks again, btw sorry for my English roll

Edit : oops everything worked fine but I just noticed that when I got into Administration pannel and I change something like board title or description I get this message :

Notice: Undefined index: default_style in /mnt/102/sda/5/3/mywebsite/forums/admin/settings.php on line 47

Notice: Undefined index: sef in /mnt/102/sda/5/3/mywebsite/forums/admin/settings.php on line 49

and a message :

 Bad request. The link you followed is incorrect or outdated.

any idea ?

Re: Unable to install PunBB 1.3

Good to know smile Enjoy PunBB

Re: Unable to install PunBB 1.3

hi its me again, have you seen my edit ?
I cant select the default style because the list is empty.
and also the URL scheme is empty.

Re: Unable to install PunBB 1.3

Replace Lines 956-961 from 'include/functions.php':

    foreach (glob(FORUM_ROOT.'style/*') as $dirname)
    {
        $tempname = basename($dirname);
        if (is_dir($dirname) && file_exists($dirname.'/'.$tempname.'.php'))
            $styles[] = $tempname;
    }

With:

    if($handle = opendir(FORUM_ROOT.'style'))
    {
        while (false !== ($dirname = readdir($handle)))
        {
            $dirname =  FORUM_ROOT.'style/'.$dirname;
            $tempname = basename($dirname);
            if (is_dir($dirname) && file_exists($dirname.'/'.$tempname.'.php'))
                $styles[] = $tempname;
        }
        closedir($handle);
    }

That should fix the empty style list. I'll post the fix for the empty URL scheme list in a minute.

9 (edited by User33 2008-11-11 21:58)

Re: Unable to install PunBB 1.3

Replace Lines 941-943 on 'include/functions.php':

    foreach (glob(FORUM_ROOT.'include/url/*') as $dirname)
        if (is_dir($dirname) && file_exists($dirname.'/forum_urls.php'))
            $schemes[] = basename($dirname);

With:

    if($handle = opendir(FORUM_ROOT.'include/url'))
    {
        while (false !== ($dirname = readdir($handle)))
        {
            $dirname =  FORUM_ROOT.'include/url/'.$dirname;
            if (is_dir($dirname) && file_exists($dirname.'/forum_urls.php'))
                $schemes[] = basename($dirname);
        }
        closedir($handle);
    }

Edit: If you're too lazy, you can download the whole fixed file from: http://garciat.us.to/code/punbb/functions.php (Right-click -> Save as...)

Btw, let me know if the link doesn't work.

10 (edited by SkyLine 2008-11-11 21:24)

Re: Unable to install PunBB 1.3

Ah yeah thanks for the file, I ve downloaded now.
I'm going to try it and I'll inform you after.
thanks again for your help smile

Edit :

Hi, everything works fine now big_smile
Now I'm able to apply changes into my admin pannel wink
Thanks for helping me Garciat smile
Hope this will help others also smile

Re: Unable to install PunBB 1.3

Thank you, Garciat.

I think we should include these changes in the forum core (in 1.3.1, for example). Anatoly?

12 (edited by User33 2008-11-12 00:40)

Re: Unable to install PunBB 1.3

parpalak wrote:

Thank you, Garciat.

I think we should include these changes in the forum core (in 1.3.1, for example). Anatoly?

You definitely should, as it seems not every server allows the use of glob().