DSO Server – wp-config.php is not writable, DB Table Prefix Changer

Home Forums BulletProof Security Free DSO Server – wp-config.php is not writable, DB Table Prefix Changer

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #16160
    James
    Participant

    [Topic has been split into this new Topic]

    Thanks.  But unfortunately with the broken site (after changing the wp table prefix) I am completely locked out.  All I get in the browser is a message saying that the page (any page frontend or backend) has too many redirect loops.  So I can’t get into the backend to try the suggested options.

    Every page (front or backend) seems to be redirecting to http://mysite.com/wp-admin/install.php which I guess no longer exists, calling the 404 page, then back to the install page, etc.  It seems wp thinks it has not been installed after changing the wp table prefix, but the install.php file was deleted after the original install.  Any idea why it might not have picked up the prefix change after this was updated via the plugin?  Is my only option to try and change it back via php admin?

    Cheers.

    #16163
    AITpro Admin
    Keymaster

    Did you use the BPS DB Table Prefix Changer to change your DB Table Prefix?
    Is your wp-config.php file writable – Ownership/Permissions?
    Was the new DB Table Prefix added to your wp-config.php file?

    #16164
    James
    Participant

    Yep, I used the new BPS db table prefix function to update the prefix.  The wp-config file might not have been writable at the time (server runs DSO so permissions are always an issue) but BPS reported that the update was successful.  But then on page reload everything was broken, both front and backend.

    I’ve checked the wp-config file and the db prefix had not been updated, so I manually changed this to the new value, but this hasn’t fixed the problem. Is it just this one variable that needs to be changed, or are there any other values I need to manually change too?

    Thanks

    #16165
    AITpro Admin
    Keymaster

    The only DB Table Prefix variable in your wp-config.php file is:  $table_prefix = 'wp_';.  Use phpMyAdmin to check your database to make sure all DB tables have the new prefix.  The cause of the redirect loop is this:  The wp-admin .htaccess file protects the /wp-admin/install.php file.  So at this point WordPress thinks you are trying to do a new installation due to whatever problem occurred.  If this was a new WordPress installation you would delete the wp-admin .htaccess file in order to allow the WordPress installation to complete.  In your case I am not sure what went wrong.  If you delete the wp-admin .htaccess file and allow access to the /wp-admin/install.php file then this may cause additional problems.  Before doing that check that your DB tables have the new prefix and double check that your wp-config.php file has the correct new DB table prefix.

    #16166
    James
    Participant

    Thanks, that useful.  I’m away for the weekend so will get back onto this Monday morning (its not an important site so I have just taken it down by redirecting the url).  The database seems to have been partially updated to the new prefix – the core tables have the old prefix but all the additional tables (the plugin tables) have the new one.  I guess this is the problem.  Maybe I’ll just revert to a backup of the database.

    Thanks for your your help, have a good weekend.  🙂

    #16167
    AITpro Admin
    Keymaster

    Hmm yeah not sure how that is possible since the DB Table Prefix Changer is all or nothing – either it will change all DB table prefixes or none of them if there is a pre-existing problem.  Looks like we need to add some additional checking conditions for DSO sites/servers or just disable the tool for DSO sites/servers.

    I checked the code and a checking condition needs to be add for “is writable” for the wp-config.php file on DSO servers.  The code currently tries to CHMOD the file permissions, but that would not work on a DSO server and would only work on a CGI server.

    #16169
    James
    Participant

    Would it be useful for you to have a look at the tables via myphpadmin to see exactly what has happened?  This sort of forensics is beyond my knowledge, so I will probably just try to restore a backup of the tables.  But I can arrange access if it would be helpful for you to have a look and see if you can diagnose what caused the problem.  If so, let me know how I can safely get login details to you.  Worst comes to the worst I will just delete the install and start again, the site is really only a place holder at the moment so not important.  However it would be good to have this BPS function working to use on my other more important wp installs that run on the same DSO server!

    #16170
    AITpro Admin
    Keymaster

    Nope that would not tell me anything.  The DB Table Prefix Change code changes all DB Table Prefixes and simultaneously changes the wp-config.php DB table prefix variable.  So if the DB table prefix variable is not successfully changed in the wp-config.php file then this will create a database connection error and or a redirect loop until the variable is changed in the wp-config.php file.  In testing the solution was just to manually edit the wp-config.php table prefix variable and the this solved this particular problem.  Unfortunately, we do not have a DSO testing server available at this time.  it was dismantled/wiped out quite a while back.  Logically the worst case scenario is:  all DB table prefixes are changed, but the wp-config.php table prefix variable is not changed due to a problem with the wp-config.php file (DSO or other problem) and the solution is just to change the variable manually.  In your case, I would suggest that you do not use the DB Table Prefix Changer tool on your sites since there may be some other factor involved since the normal scenario did not occur and something we did not encounter during testing has occurred on your particular server.

    Logically if your wp-config.php file is writable then you would be able to use the DB Table Prefix Changer tool without any problems.  Create a test WordPress site, make the wp-config.php file writable and then run the DB Table Prefix Changer tool on that test site.

    #16218
    James
    Participant

    Ok, thanks for your help.  The site was not important so it will be easy for me to just wipe it and start again with a fresh intall (it was only really a place holder thankfully, so nothing really lost – phew!).  I’m not sure what went wrong using the db table prefix changer tool other than some of the db tables seemed to have been changed but the wp-config file was not (as it was not writable).  Maybe I’ll try and play around with the tables via php admin to see if I can resolve being as I’m otherwise going to delete them all anyway, but I don’t have any time this week to do that.  But if / when I do I’ll report back any findings that might be useful.

    Cheers, James

    #16221
    AITpro Admin
    Keymaster

    We added another conditional check for the DB Table Prefix Changer to prevent this type of scenario from being possible.  The new code will be in BPS .50.4 and BPS Pro 9.1.  If the wp-config.php file is not writable then the an error will be displayed and the script will exit.

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.