Topic: error

i uploaded everything, ran install and then uploaded the config.php file

now when i try to go to the main page of the forum i get an error message "config.php does not exist or is corrupt"

Re: error

<removed bad advice> // Connorhd

Re: error

check the config.php is actually there and called config.php the name is case sensitive

Re: error

it is there and spelled correctly, deleting the install file had no effect either, now when i get the error message and click the install link it simply tells me that file no longer exists...

Re: error

well i dunno what to suggest apart from recheck config.php is there and is in the right directory, you could ask your host it might be something to do with their setup although it seems strange

6

Re: error

If the message says the file is corrupt maybe it is. Have you tried recreating config.php and uploading it again.

7 (edited by kiddo 2005-01-27 04:07)

Re: error

Hi, I got the exact same problem here. And I host myself. I'm usually not too bad with all this, since I host other people/forums and all. But the thing just won't work. My config.php was copy-pasted within seconds. I've done the install thrice via sftp. Chmodded img/avatars and cache to 777. This is a bit frustrating smile I thought I'd be able to install it up in 5 mins...

The only thing that may look similar is this thread: http://punbb.org/forums/viewtopic.php?id=6014
I don't know if I have SE Linux enabled on my gentoo 2004.3 rc3 install.

Currently running apache 2 with mysql 4.0.22 and PHP 5.0.3
¬¬ edit: did some googling. Looks like we're not alone.
http://www.ripklan.friko.pl/
http://spry.moimoije.com/forum/

Re: error

How does your config.php look? You should of course replace your real DB hostname, username and password if you post it here smile

"Programming is like sex: one mistake and you have to support it for the rest of your life."

9 (edited by Dr.Jeckyl 2005-01-27 11:53)

Re: error

ALSO make sure that when you create the file in say notepad that it isn't being created as a text file. ie: save as "all files *.*" and not "txt file" and that you have .php at the end.   i know it sounds like a bonehead move but worse has happened.

~James
FluxBB - Less is more

Re: error

Below is what the config looks like after the script was copied over

Still not having any luck here


<?php
/***********************************************************************

  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)

  This file is part of PunBB.

  PunBB is free software; you can redistribute it and/or modify it
  under the terms of the GNU General Public License as published
  by the Free Software Foundation; either version 2 of the License,
  or (at your option) any later version.

  PunBB is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  MA  02111-1307  USA

************************************************************************/


// Tell header.php to use the admin template
define('PUN_ADMIN_CONSOLE', 1);

define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
require PUN_ROOT.'include/common_admin.php';

<?php

$db_type = 'mysql';
$db_host = 'myhost.com';
$db_name = 'db_name';
$db_username = 'username';
$db_password = 'pass';
$db_prefix = '';
$p_connect = false;

$cookie_name = 'punbb_cookie';
$cookie_domain = '';
$cookie_path = '/';
$cookie_secure = 0;

define('PUN', 1);

?>
{
    confirm_referrer('admin_bans.php');

    $ban_user = trim($_POST['ban_user']);
    $ban_ip = trim($_POST['ban_ip']);
    $ban_email = strtolower(trim($_POST['ban_email']));
    $ban_message = trim($_POST['ban_message']);
    $ban_expire = trim($_POST['ban_expire']);

    if ($ban_user == '' && $ban_ip == '' && $ban_email == '')
        message('You must enter either a username, an IP address or an e-mail address (at least).');

    // Validate IP/IP range (it's overkill, I know)
    if ($ban_ip != '')
    {
        $ban_ip = preg_replace('/[\s]{2,}/', ' ', $ban_ip);
        $addresses = explode(' ', $ban_ip);
        $addresses = array_map('trim', $addresses);

        for ($i = 0; $i < count($addresses); ++$i)
        {
            $octets = explode('.', $addresses[$i]);

            for ($c = 0; $c < count($octets); ++$c)
            {
                $octets[$c] = (strlen($octets[$c]) > 1) ? ltrim($octets[$c], "0") : $octets[$c];

                if ($c > 3 || preg_match('/[^0-9]/', $octets[$c]) || intval($octets[$c]) > 255)
                    message('You entered an invalid IP/IP-range.');
            }

            $cur_address = implode('.', $octets);
            $addresses[$i] = $cur_address;
        }

        $ban_ip = implode(' ', $addresses);
    }

    require PUN_ROOT.'include/email.php';
    if ($ban_email != '' && !is_valid_email($ban_email))
    {
        if (!preg_match('/^[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/', $ban_email))
            message('The e-mail address (e.g. user@domain.com) or partial e-mail address domain (e.g. domain.com) you entered is invalid.');
    }

    if ($ban_expire != '' && $ban_expire != 'Never')
    {
        $ban_expire = strtotime($ban_expire);

        if ($ban_expire == -1 || $ban_expire <= time())
            message('You entered an invalid expire date. The format should be YYYY-MM-DD and the date must be at least one day in the future.');
    }
    else
        $ban_expire = 'NULL';

    $ban_user = ($ban_user != '') ? '\''.$db->escape($ban_user).'\'' : 'NULL';
    $ban_ip = ($ban_ip != '') ? '\''.$db->escape($ban_ip).'\'' : 'NULL';
    $ban_email = ($ban_email != '') ? '\''.$db->escape($ban_email).'\'' : 'NULL';
    $ban_message = ($ban_message != '') ? '\''.$db->escape($ban_message).'\'' : 'NULL';

    if ($_POST['mode'] == 'add')
        $db->query('INSERT INTO '.$db->prefix.'bans (username, ip, email, message, expire) VALUES('.$ban_user.', '.$ban_ip.', '.$ban_email.', '.$ban_message.', '.$ban_expire.')') or error('Unable to add ban', __FILE__, __LINE__, $db->error());
    else
        $db->query('UPDATE '.$db->prefix.'bans SET username='.$ban_user.', ip='.$ban_ip.', email='.$ban_email.', message='.$ban_message.', expire='.$ban_expire.' WHERE id='.$_POST['ban_id']) or error('Unable to update ban', __FILE__, __LINE__, $db->error());

    // Regenerate the bans cache
    require_once PUN_ROOT.'include/cache.php';
    generate_bans_cache();

    redirect('admin_bans.php', 'Ban '.(($_POST['mode'] == 'edit') ? 'edited' : 'added').'. Redirecting …');
}


// Remove a ban
<?php

$db_type = 'mysql';
$db_host = 'myhost.com';
$db_name = 'db_name';
$db_username = 'username';
$db_password = 'pass';
$db_prefix = 'x';
$p_connect = false;

$cookie_name = 'punbb_cookie';
$cookie_domain = '';
$cookie_path = '/';
$cookie_secure = 0;
$cookie_seed = 'd5fad767';

define('PUN', 1);

?>

Re: error

What the? smile The only part of that that should be in the config file is this:

<?php

$db_type = 'mysql';
$db_host = 'myhost.com';
$db_name = 'db_name';
$db_username = 'username';
$db_password = 'pass';
$db_prefix = 'x';
$p_connect = false;

$cookie_name = 'punbb_cookie';
$cookie_domain = '';
$cookie_path = '/';
$cookie_secure = 0;
$cookie_seed = 'd5fad767';

define('PUN', 1);

?>
"Programming is like sex: one mistake and you have to support it for the rest of your life."

12 (edited by kiddo 2005-01-27 14:34)

Re: error

Yeah, I do only have the coded part in my case wink as instructed. Here's mine.

removed, takes space for nothing :)

What's that cookie seed? A timeout? Anyways..

ALSO make sure that when you create the file in say notepad that it isn't being created as a text file. ie: save as "all files *.*" and not "txt file" and that you have .php at the end.   i know it sounds like a bonehead move but worse has happened.

Don't worry smile don't have notepad, and I can see all the file extensions and permissions directly from here.
Speaking of which... the files around carry -rw-r--r--, but config.php carries only -rw------... that may be the problem. I'll change this a bit and edit.


//Edit: *proud* heheh, that was it. The config file did not have read permissions for everyone. Maybe that should be added to an FAQ, may happen again sometime... ^^ So basically that means chmodding, for those who use FTP, the config.php file to 744 (I think.. I never understood the logic in chmod numbers)

Re: error

kiddo: That is quite uncommon. Did you create the file directly on the server or did you upload it via (S)FTP?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

14

Re: error

Don't remember, must've created it directly (and my nautilus was behaving kinda weird last night..) anyways, what I do know is that I chmodded my local file and replaced the one on sftp. That fixed it.