26

(14 replies, posted in PunBB 1.2 bug reports)

Smartys wrote:

It's a problem with admin_options.php

The fix:

FIND

        // Only update values that have changed
        if (isset($pun_config['o_'.$key]) && $pun_config['o_'.$key] != $input)

REPLACE WITH

        // Only update values that have changed
        if (array_key_exists('o_'.$key.'', $pun_config) && $pun_config['o_'.$key] != $input)

The problem is when values are NULL, isset is false, whereas array_key_exist is true

Hi,

I have zero-experience with PHP (coming from the Perl land smile )
but why the seconde pair of quotes above? Can't you just

        // Only update values that have changed
        if (array_key_exists('o_'.$key, $pun_config) && $pun_config['o_'.$key] != $input)

Regards
Alex

Queen Elizabeth II wrote:

Unfortunately I cannot get it to remember my SMTP server. I enter the server in the form on admin_options.php and get no error when saving the changes. Hovever when the options page reloads, the server is gone and the box is empty. No e-mails arrive (obviously).
I cannot use my MTA because of ISP restrictions (port 25 is blocked).

My setup:
Debian stable, Apache2, PHP 4.3.10-15, Mysql 4.1, PunBB 1.2.6.

Same problem here with

OpenBSD stable, Apache/1.3.29, PHP/5.0.4, PunBB 1.2.6

And one more question please:

I browsed through quite many old posts here when trying to solve
this problem and wonder where do you guys (and girls!) see the
error messages? I see nothing in Apaches' error_log and I don't see
anything in the browser even though I removed the comment from

define('PUN_DEBUG', 1);

in /var/www/htdocs/forum/include/common.php

Hi,

for the archives I'd like to share a short report about successfull
installation of the web forum from http://www.punBB.org on an PC
running OpenBSD 3.7 (which runs Apache 1.3.x with many
security patches and in a chroot cool ):

1) I've downloaded and installed (using pkg_add) the following packages
   from ftp://ftp.de.openbsd.org/unix/OpenBSD/3 … ages/i386/  :

       php5-core-5.0.4
       php5-pgsql-5.0.4
       postgresql-client-7.4.3p2
       postgresql-server-7.4.3p2
       mini_sendmail-chroot-1.3.5

2) Then I followed the instructions printed by "pkg_info -D package_name"
    for each of those packages and also the instructions listed in the file
        /usr/local/share/doc/postgresql/README.OpenBSD

3) Prepended "index.php" to this line to /var/www/conf/httpd.conf :
       

DirectoryIndex index.php index.html

4) Added this line to /var/postgresql/data/postgresql.conf
       

unix_socket_directory = '/var/www/tmp'

5) Added 2 lines to /etc/rc.conf.local :

       httpd_flags=""
       postgresql=YES

6) Added this to /etc/rc.local:

       if [ X"${postgresql}" = X"YES" -a -x /usr/local/bin/pg_ctl ]; then
               su -l _postgresql -c "nohup /usr/local/bin/pg_ctl start \
                       -D /var/postgresql/data -l /var/postgresql/logfile \
                       -o '-D /var/postgresql/data'"
               echo -n ' postgresql'
       fi

7) and this to /etc/rc.shutdown :

       if [ -f /var/postgresql/data/postmaster.pid ]; then
               su -l _postgresql -c "/usr/local/bin/pg_ctl stop -m fast \
                       -D /var/postgresql/data"
               rm -f /var/postgresql/data/postmaster.pid
       fi

8) Then I unpacked http://punbb.org/download/punbb-1.2.6.tar.gz
    and copied the content of the upload/ subdir into /var/www/htdocs/punbb

    I've also download Russian.zip from that website and put it under
        /var/www/htdocs/punbb/lang

9) The files and dirs under /var/www/htdocs/punbb belong to root:daemon
    and the ones under /var/postgresql to the _postgresql user, but I had
    to create an additional dir and to change few permissions:

       mkdir /var/www/tmp  (this dir holds the postgresql unix socket)
       chmod a+rwt /var/www/tmp

       chgrp www /var/www/htdocs/punbb/{cache,img/avatars}
       chmod g+rwt /var/www/htdocs/punbb/{cache,img/avatars}

10) Added a database and user to postgresql using createdb
     and createuser

11) Put Copied /bin/sh because php calls popen for running mini_sendmail
           

cp -p /bin/sh /var/www/bin/sh

12) Put this line into /var/www/conf/php.ini
           

sendmail_path = "/bin/mini_sendmail -t -i"

13) And finally used a trick when running (in a browser)
     http://www.my.domain/punbb/install.php after a reboot:

     I have entered /tmp into the "hostname" text field -
     this made punBB to connect to the postgresql database
     through the local unix socket /var/www/tmp/.s.PGSQL.5432

Thank you for the punBB software smile

Regards
Alex