• Let me preface this by I’m very much a novice when it comes to dealing with PHP files…

    Here’s what happened: I had backed up my site via copying everything through my FTP client. I then tried to make an automated backup, and instead set up a sync. When it ran yesterday, it synced over the top of what I had previously copied off, so now I suspect my backup is bad as well. Now, my install of WP is nuked and I don’t know what to do. The exact error I’m receiving when I pull up my site is:

    Fatal error: Call to undefined method stdClass::set_prefix() in /home/content/s/t/r/*username*/html/wp-settings.php on line 268

    I have tried reuploading the backup I have to see if it would work, but since this sync ruined the backup I have, it didn’t work either.

    My site doesn’t have much on it, but I’d like to get it back running and not start from scratch. If I do have to punt and start over, is there any way to salvage my content from the junk backup I’ve got? I have found and saved my pages from Google’s cashe…

    Thanks for any help…

Viewing 15 replies - 1 through 15 (of 18 total)
  • Firstly, I’d backup your db (try phpmyadmin). Then get a fresh copy of wordpress and upload it to your ftp, over the old copy. You might find it’s not a problem

    Thread Starter man-on-the-door

    (@man-on-the-door)

    I don’t see any file with that name in my backup or in what I’ve copied off of my site this morning. Would there be another name?

    Thanks for the quick response…

    Thread Starter man-on-the-door

    (@man-on-the-door)

    Oh — I see that’s a program to get the backup. I’ll work on this for a bit…

    Did this solve your problem? I’m having a bit of trouble with this myself.

    Thread Starter man-on-the-door

    (@man-on-the-door)

    Well, I decided that backing up to that extent was more than I wanted to do. My site is small enough that I just grabbed google’s cashe versions of all my posts and just reposted them to the site.

    I ended up doing a full uninstall of WP and reinstall. Then once it was working again, I tried to copy my good ‘backup copy’ into certain areas of the root folder, but that messed stuff up again. Then after another unistall/reinstall and another reposting, I’m back up and running.

    Call to a member function set_prefix() on a non-object, line 255
    Call to undefined method stdClass::set_prefix() in wp-settings.php on line 268

    Same problem here. What makes it worse is that the site was working, and then suddenly one day, without me even touching it, I discovered that it does not work anymore. I disabled all the plugins, deleted some of them, installed WP 2.8.2 but it didn’t make any difference.

    I get the same error when trying to change the theme too.

    I have gone through a painful process of trying to identify what causes the problem (step by step tests below) and I came to the conclusion that the problem is potentially caused by “corrupted” .htaccess file. I can’t prove it without having to go through the whole exercise again, but, before You even have a look at all the things I tried (without success), try this, it only takes 5 mins:

    • rename your .htaccess file to something else (“.htaccess.bak” for example). If You have wp installed in “www.domain.com/wp” dir and running it from “www.domain.com” root dir – rename the .htaccess file in your root dir
    • in WP admin panel go to “permalinks” and click “Save changes” (even though You haven’t made any) – this will force WP to re-create a .htaccess file for You
    • try your website now

    ————————————————-
    Below are all the things I tried without much luck. This listing also indicates that the problem was caused by .htaccess file.

    -) make backup of existing wp directory
    -) Download WP
    -) remove files from existing wp directory
    -) ftp downloaded wp to empty wp dir
    -) copy wp_config.php from your backup dir to your wp dir – check if site is working:
    Fatal error: Call to undefined method stdClass::set_prefix() in …/wp-settings.php on line 268</p>
    <p>-) delete wp_config.php and rename wp_config_sample.php to wp_config.php (so we have blank settings / can’t access db):
    Fatal error: Call to undefined method stdClass::set_prefix() in …/wp-settings.php on line 268
    Can’t access admin panel either, same error</p>
    <p>-) Trying to run wp-admin/upgrade.php:
    Fatal error: Call to undefined method stdClass::set_prefix() in …/wp-settings.php on line 268</p>
    <p>-) Trying to run wp-admin/install.php:
    Fatal error: Call to undefined method stdClass::set_prefix() in …/wp-settings.php on line 268</p>
    <p>-) move .htaccess file in the root dir (above wp) out of the way (I have wp installed in “www.domain.com/wp” subdir but accessed from “www.domain.com” root dir) and try to run wp-admin/upgrade.php again:
    First success: “No upgrade required” message. admin is working again as well. http://www.domain.com showing a blank page.</p>
    <p>-) restore .htaccess file in the root dir
    Fatal error: Call to undefined method stdClass::set_prefix() in …/wp-settings.php on line 268</p>
    <p>-) move .htaccess file in the root dir (above wp) out of the way again and force the upgrade by:
    SELECT * FROM wp_optionswhereoption_name
    `
    = “db_version”
    UPDATE wp_options set option_value = 9872 where option_name = “db_version”
    Result: blank page again

    -) Force WordPress to regenerate .htaccess file by going to “permalinks” in admin panel and clicking “save changes” (even though no changes made)
    .htaccess page regenerated – much cleaner than what I had

    -) Go to themes and change the default theme (database points to the theme that doesn’t exist)
    Success – the site is now working in default theme

    -) Restore my theme from the backup and activate it
    Sucess – the site is working now

    All very well but I can’t access the admin function to do this because of the corrupted htaccess file and I’ve tried uploading the previous htaccess file but that hasn’t helped either.

    Not impressed that upgrading has caused this problem – it’s not my site but a client’s site.

    Looks like I’m going to have to do a removal, new installation and then run the backup database in the hope it will restore it all.

    I am having this same issue… hoping someone can solve and help us.

    I’ve been able to restore a former copy of the blog but this does not resolve the issue that doing an upgrade is going to cause another problem. This means I have no confidence in doing anything further on this particular blog for fear of it happening again.

    Please post your url’s.

    Mine is http://www.paddyspruce.org – I’ve had my IT guy restore back to previous backup so it’s now in the earlier version of WP.

    Ok, I believe I’ve found the problem – at least for my case.

    I increased the amount of webspace available to this particular site as it was close to the edge and then reran the upgrade and now it’s working fine. But I could only do this because my IT guy restored it to a previous backup and version so I could run fresh with it.

    All working now.

    I increased the amount of webspace available to this particular site as it was close to the edge

    Memory? Page size? I don’t understand webspace?

    Deleting the htaccess file solved this problem for me. I backed up first before deleting it. As soon as removed it, refreshed my WordPress login and the error stopped occurring. I haven’t created a new htaccess file yet but I thought it was worth noting the source of the problem.

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Fatal Error – wp-settings.php, line 268’ is closed to new replies.