WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Absolute root path problem after move? (18 posts)

  1. matt richards
    Member
    Posted 2 years ago #

    I recently moved servers/hosting providers, but my blog URL remained the same.

    At first I was getting some 404 errors when clicking away from the home page but fixed this by means of uploading the .htaccess file.

    All the links and content to my website are now visible and work apart from the following that result in a blank screen;

    my admin login page AFTER entering login details;

    http://www.MYSITENAME.com/wp-login.php

    home page when "www." is not specified (e.g. my "home" link on the menu);

    http://MYSITENAME.com

    I've tried deactivating all plugins, I've also tried testing if a theme is to blame as per this instruction

    I have moved from GoDaddy who use a slightly different absolute path structure to that of my new host. I suspect that this might be the culprit?

    Godaddy structure;

    /home/content/a/b/c/myaccount/html/wp-content

    New Structure;

    public_html/wp-content

    I have found a few of these using PHPmyAdmin and corrected them (all were themes or plugins in wp-options). But I have limited knowledge of running queries and those that I have changed have made no difference.

    Procedure I followed when moving servers;
    Backed up database and files.
    Uploaded files onto new server, imported database.
    edited the config. file to look at the new database.

    Be great to hear suggestions and if my guess is correct, can someone give me an idiots guide of finding and replacing any other old root paths in the database?

    Thanks in advance!

  2. esmi
    Forum Moderator
    Posted 2 years ago #

  3. matt richards
    Member
    Posted 2 years ago #

    Thanks but I was following that post's instruction.

    The URLS remain the same so should of just been a simple change of the config. file.

  4. esmi
    Forum Moderator
    Posted 2 years ago #

    There shouldn't be any path issues (if it helps, many of my sites use a similar path structure to your new server) as WP picks up the paths from the server itself. Might be worth having a word with your new hosts to see if there's a server problem.

  5. matt richards
    Member
    Posted 2 years ago #

    I've subsequently moved other sites (add-on domains) without a problem so I doubt that it is the server causing this?

  6. esmi
    Forum Moderator
    Posted 2 years ago #

    You could check exactly what WP is using for the absolute path by temporarily adding <?php echo ABSPATH;?> to one of your theme's template files (outside of the Loop).

  7. Peter Wooster
    Member
    Posted 2 years ago #

    The easiest way to find things like this in your database is to take a database dump to an SQL file using phpMySQL or the mySQL Administrator. The resulting text file can then be searched using a text editor.

    Have you turned on debug in your wp_config.php. That often helps with blank screen problems.

  8. matt richards
    Member
    Posted 2 years ago #

    Would you be able to give a step by step on that database dump?

    I did run a debug earlier but this is beyond my realms.

    This is the log it reported.

    [21-Dec-2011 19:09:41] PHP Notice: wp_deregister_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /home/mattr752/public_html/wp-includes/functions.php on line 3578

    [21-Dec-2011 19:09:41] PHP Notice: wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /home/mattr752/public_html/wp-includes/functions.php on line 3578

    [21-Dec-2011 19:09:46] PHP Notice: wp_deregister_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /home/mattr752/public_html/wp-includes/functions.php on line 3578

    [21-Dec-2011 19:09:46] PHP Notice: wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /home/mattr752/public_html/wp-includes/functions.php on line 3578

    [21-Dec-2011 19:09:53] PHP Notice: wp_deregister_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /home/mattr752/public_html/wp-includes/functions.php on line 3578

    [21-Dec-2011 19:09:53] PHP Notice: wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /home/mattr752/public_html/wp-includes/functions.php on line 3578

    [21-Dec-2011 19:09:54] PHP Notice: wp_deregister_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /home/mattr752/public_html/wp-includes/functions.php on line 3578

    [21-Dec-2011 19:09:54] PHP Notice: wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /home/mattr752/public_html/wp-includes/functions.php on line 3578

    [21-Dec-2011 19:09:58] PHP Notice: wp_deregister_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /home/mattr752/public_html/wp-includes/functions.php on line 3578

    [21-Dec-2011 19:09:58] PHP Notice: wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /home/mattr752/public_html/wp-includes/functions.php on line 3578

    [21-Dec-2011 19:10:00] PHP Notice: wp_deregister_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /home/mattr752/public_html/wp-includes/functions.php on line 3578

    [21-Dec-2011 19:10:00] PHP Notice: wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /home/mattr752/public_html/wp-includes/functions.php on line 3578

    [21-Dec-2011 19:10:04] PHP Notice: wp_deregister_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /home/mattr752/public_html/wp-includes/functions.php on line 3578

    [21-Dec-2011 19:10:04] PHP Notice: wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /home/mattr752/public_html/wp-includes/functions.php on line 3578

    [21-Dec-2011 19:10:20] PHP Notice: wp_deregister_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /home/mattr752/public_html/wp-includes/functions.php on line 3578

    [21-Dec-2011 19:10:20] PHP Notice: wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /home/mattr752/public_html/wp-includes/functions.php on line 3578

  9. matt richards
    Member
    Posted 2 years ago #

    Ok I found a video tutorial to dump the database

    opening the .sql file in text edit, and doing a "find" for the old root path does bring up a lot of results.

    Could this be the fix? If so how do I run a "find & replace" in the database?

  10. Peter Wooster
    Member
    Posted 2 years ago #

    Database Dump:

    If you have phpMyAdmin you do an "export" to get a dump of the database. You might still have one left over from your move to the new site. If you can't do that yourself, you can probably get one from your hosting company.

    Debug Log:

    I don't see anything in that log that relates to bad paths, run your site with
    define('WP_DEBUG', true);
    set in wp_config.php and check if anything is displayed on the screen when you get that blank page.

  11. Peter Wooster
    Member
    Posted 2 years ago #

    You should figure out what the absolute paths are. Fixing them in the database may not be the complete solution a some piece of code put them there. Doing a search and replace in the database is tricky and I would't recommend it if you are not familiar with SQL.

    I've done the search and replace in the text file and then imported that file into a new database and then switched over to the new database. Don't try to restore into the existing database.

    - do search and replace in text file
    - create new database
    - add user to new database
    - import text file into new database
    - modify wp_config.php to use new database.

  12. matt richards
    Member
    Posted 2 years ago #

    I worked through the "find and replace" process, creating a new database.

    Exactly same result. Blank screen.

    I have added the WP_DEBUG and get the following;

    Notice: wp_deregister_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /home/mattr752/public_html/wp-includes/functions.php on line 3578

    Notice: wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /home/mattr752/public_html/wp-includes/functions.php on line 3578

    I am still running the new database, (with the corrected absolute paths).

  13. esmi
    Forum Moderator
    Posted 2 years ago #

    Those are warnings relating to your plugin or theme. Have you tried:

    - deactivating all plugins to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s).

    - switching to the Twenty Eleven theme to rule out any theme-specific problems.

    - resetting the plugins folder by FTP or PhpMyAdmin. Sometimes, an apparently inactive plugin can still cause problems.

  14. matt richards
    Member
    Posted 2 years ago #

    Thanks Esmi,

    I have tried this but I get the following when deactivating plugins on the login page;

    Warning: Cannot modify header information - headers already sent by (output started at /home/mattr752/public_html/wp-config.php:153) in /home/mattr752/public_html/wp-login.php on line 349

    Warning: Cannot modify header information - headers already sent by (output started at /home/mattr752/public_html/wp-config.php:153) in /home/mattr752/public_html/wp-login.php on line 361

    And then this after trying to log in

    Warning: Cannot modify header information - headers already sent by (output started at /home/mattr752/public_html/wp-config.php:153) in /home/mattr752/public_html/wp-login.php on line 349

    Warning: Cannot modify header information - headers already sent by (output started at /home/mattr752/public_html/wp-config.php:153) in /home/mattr752/public_html/wp-login.php on line 361

    Warning: Cannot modify header information - headers already sent by (output started at /home/mattr752/public_html/wp-config.php:153) in /home/mattr752/public_html/wp-includes/pluggable.php on line 669

    Warning: Cannot modify header information - headers already sent by (output started at /home/mattr752/public_html/wp-config.php:153) in /home/mattr752/public_html/wp-includes/pluggable.php on line 670

    Warning: Cannot modify header information - headers already sent by (output started at /home/mattr752/public_html/wp-config.php:153) in /home/mattr752/public_html/wp-includes/pluggable.php on line 671

    Warning: Cannot modify header information - headers already sent by (output started at /home/mattr752/public_html/wp-config.php:153) in /home/mattr752/public_html/wp-includes/pluggable.php on line 866

    I tried this first with plugins disabled. And then again with all themes except twenty eleven moved out of themes folder aswell.

  15. esmi
    Forum Moderator
    Posted 2 years ago #

  16. matt richards
    Member
    Posted 2 years ago #

    BINGO!!!!!!
    There were 2 spaces at the end of config file.
    I have disabled plugins and now can log in!!!!!

    Found 2 guilty plugins that I don't use anyway.

    Thanks so much for you help and patience, I can start clearing the office for our Christmas holiday now!

  17. esmi
    Forum Moderator
    Posted 2 years ago #

    Glad to hear that you finally got it sorted. :-)

  18. MarianoFerro
    Member
    Posted 2 years ago #

    "Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks"

    Before call "wp_deregister_script, wp_register_script, wp_enqueue_script"
    write "$wp_scripts = new WP_Scripts();"

Topic Closed

This topic has been closed to new replies.

About this Topic