• [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    We installed WP Multisite into a subdomain directory for staging and testing before going live with a new version of our website. We thought this would make life easier for us, or so we thought. We have the site fully built and tested, working fine at subdomain.maindomain.com and the WordPress files all work great where they are installed in a folder called /subdomain

    The problem is that today we planned to simply move the files over to the root directory- no need to change the database settings or anything like that – just thought we would modify wp-config.php slightly from

    define('WP_DEBUG', true);
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    $base = '/';
    define('DOMAIN_CURRENT_SITE', 'subdomain.maindomain.com');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);
    /* That's all, stop editing! Happy blogging. */
    
    /** Absolute path to the WordPress directory. */
    if ( !defined('ABSPATH') )
    	define('ABSPATH', dirname(__FILE__) . '/');
    
    /** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');
    define('WP_ALLOW_MULTISITE',true);

    to this:

    define('WP_DEBUG', true);
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    $base = '/';
    define('DOMAIN_CURRENT_SITE', 'www.maindomain.com');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);
    /* That's all, stop editing! Happy blogging. */
    
    /** Absolute path to the WordPress directory. */
    if ( !defined('ABSPATH') )
    	define('ABSPATH', dirname(__FILE__) . '/');
    
    /** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');
    define('WP_ALLOW_MULTISITE',true);

    Now we get this T_STRING error on https://www.maindomain.com – HELP!

Viewing 4 replies - 1 through 4 (of 4 total)
  • File-based migrations for CMS’s can be tricky. There are often settings embedded in the database. I’ve used this method myself a few times, and managed to struggle through, but it would probably be much easier to do a fresh WP multisite install on your www sub-domain and then export/import the content from testing to production.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    The problem is that today we planned to simply move the files over to the root directory- no need to change the database settings or anything like that – just thought we would modify wp-config.php slightly from

    You can’t do that with Multisite, you have to read https://codex.www.ads-software.com/Moving_WordPress#Moving_WordPress_Multisite

    Thread Starter ineedwordpress

    (@ineedwordpress)

    Mika – thank you soooo much for your post. I actually was exhausted and was out of commission yesterday after working through the night Sunday to find a work-around. Had to bail on the migration project and restore the previous version of the site.

    I actually resolved the syntax error early on in the process. It was the wp-config.php file getting messed up during FTP. BINARY mode was the thing that worked – just on the wp-config file. Error went away immediately.

    After that an entirely new problem became apparent. Links to individual posts and links to individual pages did not work. Everything resolved to the Home Page – not even the 404 error page.

    All of the category-level links worked fine (although they included /blog/ which I do not like – and I planned to use a .htaccess redirect for inbound traffic missing the /blog/ until I had time to get rid of that). But what absolutely threw me was that none of the other links would work at all – everything ended up on the home page.

    According to your codex link – it suggests that the database edits required are far more extensive than the few I had made – it suggests a full search and replace – but a manual one. There is a link to what is called a safe search and replace script – do you have any experience working with it?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Yes ?? I wrote those directions actually ?? Script is great, works wonderfully.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Parse error: syntax error, unexpected T_STRING in /wp-config.php on line 1’ is closed to new replies.