forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 upgrading => Topic started by: lextech on October 05, 2009, 06:48:48 am

Title: Problem with upgrade and SQL restore same returning error
Post by: lextech on October 05, 2009, 06:48:48 am
I've searched and found tons of info, just nothing about the fix in the php file when getting the error via fantastico so please see my issue as I know when the upgrade went wrong.

First the error:

Quote
Warning: Cannot modify header information - headers already sent by (output started at /home/XXXXXXXX/public_html/gallery/index.php:751) in /home/XXXXXXXX/public_html/gallery/themes/eyeball/theme.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /home/XXXXXXXX/public_html/gallery/index.php:751) in /home/XXXXXXXX/public_html/gallery/themes/eyeball/theme.php on line 840

Warning: Cannot modify header information - headers already sent by (output started at /home/XXXXXXXX/public_html/gallery/index.php:751) in /home/XXXXXXXX/public_html/gallery/include/functions.inc.php on line 51

Secondly, the things that have been done to try and remedy this........

~since the auto upgrade failed through fantastico when it hung on an error (this one: http://grab.by/7BO), I installed a second instance of coppermine and it was fine. Then I dropped the tables in myphpadmin and restored the second SQL from backup and it ended up having the same error on the second gallery as well so it is in my SQL backup now.

~ now I have two galleries, one upgraded, one clean install, both with the same error after restoring the SQL on gallery 2 with gallery 1.

I'm good with editing php if someone can help me pinpoint hat needs to be done, there's no use in doing the full upgrade with it already upgraded now, just have a little problem if anyone would please give me some advice. :)

THANKS!!
Title: Re: Problem with upgrade and SQL restore same returning error
Post by: lextech on October 05, 2009, 07:00:55 am
This should be line 51 in the php. Looks ok to me?


(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fi32.photobucket.com%2Falbums%2Fd5%2Faudiogodz1%2FScreenshot2009-10-05at125747AM.jpg&hash=de4d863eddda863eb1b662a480108f0e11cf73a9)
Title: Re: Problem with upgrade and SQL restore same returning error
Post by: Joachim Müller on October 05, 2009, 08:22:45 am
Title: Re: Problem with upgrade and SQL restore same returning error
Post by: lextech on October 05, 2009, 05:58:47 pm
Always nice to get a warm welcome. We'll see if my menalto gallery install goes smoother.
Title: Re: Problem with upgrade and SQL restore same returning error
Post by: lextech on October 05, 2009, 07:48:22 pm
Proper answer for others needing help, remove this from the bottom of the index/php file.

Code: [Select]
// Speed-up the random image query by 'keying' the image table

    if (time() - $CONFIG['randpos_interval'] > 86400) {

        $result = db_query("SELECT count(*) FROM {$CONFIG['TABLE_PICTURES']} WHERE 1");

        $nbEnr = mysql_fetch_array($result);

        mysql_free_result($result);

        $pic_count = $nbEnr[0];

        $granularity = floor($pic_count / RANDPOS_MAX_PIC);

        $result = db_query("UPDATE {$CONFIG['TABLE_PICTURES']} SET randpos = ROUND(RAND()*$granularity) WHERE 1");

        $result = db_query("UPDATE {$CONFIG['TABLE_CONFIG']} SET value = '" . time() . "' WHERE name = 'randpos_interval'");

}


Title: Re: Problem with upgrade and SQL restore same returning error
Post by: Nibbler on October 05, 2009, 09:27:03 pm
Looks like you're running Coppermine 1.3, which has not been supported for quite some time now. Update to the current release.