PDA

View Full Version : Error in includes/functions.php after restoring database


Cle
Fri 24th Feb '06, 5:10pm
Hey,

I have posted a thread a few days back saying that I couldn't transfer my database. The old hosting where my database currently is hosted uses MySQL 4.1.14-standard-log, and my new hosting has upgraded the MySQL version to 4.1.14-standard-log for me as well. Now, if I do the usual back-up and restore method (as described here (http://www.vbulletin.com/docs/html/manual_database_backup)) and I upload all the php files from the old hosting to the new one, I get a few errors.

First of all, if I go to the index page, it says on the top of the page:
Warning: array_keys(): The first argument should be an array in /includes/functions.php on line 3230

Warning: Invalid argument supplied for foreach() in /includes/functions.php on line 3230

Secondly, if I try to log in into the admin cp, it says:
Unable to add cookies, header already sent.
File: /home/theoran/public_html/includes/class_core.php
Line: 2983

I already tried looking in both files, but I'm clueless. I also already tried to upgrade the 3.5.3 to 3.5.4, but that didn't work either. Is there anyone who can help me out?

Thanks in advance,
Cle.

Steve Machol
Fri 24th Feb '06, 5:13pm
There are several backup and restore methods in the manual. Which one did you use?

Cle
Fri 24th Feb '06, 5:18pm
I use phpMyAdmin. There doesn't seem to be an error while uploading the database, only when I have uploaded the files and actually use them (as in browsing).

Steve Machol
Fri 24th Feb '06, 10:20pm
Can you make a new backup and restore it? The only consistently reliable method of backing up and restoring a database is with shell access via telnet or ssh. Please see the instructions here:

Backup:
http://www.vbulletin.com/docs/html/maintenance_ssh_backup

Restore:
http://www.vbulletin.com/docs/html/maintenance_ssh_restore

This is because backing up with a PHP script like that in the Admin CP or phpMyAdmin can result in PHP timeout errors and an incomplete backup file.

Cle
Sat 25th Feb '06, 5:07am
Okay, I'll try and see what I can do with shell access.

Do you happen to know what is causing that error by any chance? If I go to the 3230 line, it says:
foreach (array_keys($vbulletin->forumcache) AS $forumid)

Steve Machol
Sat 25th Feb '06, 2:16pm
That means there is something wrong with the forum cache.

Cle
Sun 26th Feb '06, 1:01pm
Okay, so I hit the "Rebuild Post Cache" button in the admin cp of my old hosting and then backed it up and uploaded to the new, the error seemed to have disappeared now. However, after I have logged in, I can't view any forum because it says:
Unable to add cookies, header already sent.
File: /home/orange/public_html/includes/functions.php
Line: 865

If I go to that line, it says:
if (!$usecache OR !isset($vbulletin->forumcache["$forumid"]))

So what is exactly wrong?

Steve Machol
Sun 26th Feb '06, 5:02pm
Do this. Upload the tools.php script in the 'do_not_upload' folder of the vB zip file to your Admin CP directory. Then run the [Usergroup/Forum Cache] option. This should fix this.

Cle
Mon 27th Feb '06, 5:54am
Hmm, I ran the Usergroup/Forum Cache option, but it still gives me that error. Everything else seems to work fine, except for viewing a forum. :S

Steve Machol
Mon 27th Feb '06, 1:22pm
Which version of vB are you running? Have you tried reuploading the original files for your version?

Cle
Mon 27th Feb '06, 2:43pm
I'm running vB 3.5.3 at the moment, I hadn't have the chance to upgrade to 3.5.4 yet. I also haven't made any alterations on the original files, so the error shouldn't be in the php files, I think. :S

Steve Machol
Mon 27th Feb '06, 3:02pm
Fill out a support ticket at:

http://members.vbulletin.com/membersupport_contactform.php

Be sure to include the login info to your Admin CP, phpMyAdmin and FTP. Please also include a complete description of the problem.