• Resolved Bernardneo

    (@bernardneo)


    Hi,

    Need help.

    I just uploaded my webpage from local host (local PC) to the remote host. I copied all the files of WP from my local PC to the remote host. Exported the local DB. Created the DB in the remote host, and imported the DB in to the host.

    I used the search and replace plugin to update the WP-config file.

    However, when i tried to see the webpage, i received the below error.

    PHP Parse error: syntax error, unexpected ”);’ (T_CONSTANT_ENCAPSED_STRING) in /home/sorelsgc/public_html/wp-config.php on line 25

    Anyone can help advice what is the problem?

    Thanks

Viewing 13 replies - 1 through 13 (of 13 total)
  • Looks like the error might be pointing to an issue in your wp-config.php file. Have you updated this as per your remote hosts’ configuration?

    This might help: https://codex.www.ads-software.com/Editing_wp-config.php

    Thread Starter Bernardneo

    (@bernardneo)

    Sorry, but i don’t understand. What do you mean?

    do you mean
    /** MySQL hostname */
    define(‘DB_HOST’, ‘localhost’);

    I did not change the DB_HOST. Do i need to change that?

    Thanks

    Yes, you will typically need to change these values in wp-config.php to match your host’s database:

    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define( 'DB_NAME', 'database_name_here' );
    
    /** MySQL database username */
    define( 'DB_USER', 'username_here' );
    
    /** MySQL database password */
    define( 'DB_PASSWORD', 'password_here' );
    
    /** MySQL hostname */
    define( 'DB_HOST', 'localhost' );

    These will be different from your local PC environment. It’s a good idea to make a backup of your local wp-config.php first. Obviously if you change this, it will break your working local setup.

    Thread Starter Bernardneo

    (@bernardneo)

    Just checked. The SQL hostname is localhost

    I would check the other values too against your remote host. i.e. Database name, username, password. These all need setting properly.

    Re-reading your original post, you said you used a plugin to update the wp-config file. Was this a WordPress plugin?

    Thread Starter Bernardneo

    (@bernardneo)

    Nope. It is not from WP. It is a script by interconnectit

    https://interconnectit.com/products/search-and-replace-for-wordpress-databases/

    called searchreplacedb2.php

    I see. I haven’t used that plugin before, but I get the gist of it and it’s made by some good WordPress folks.
    Did you run this locally, then upload the files and database? If so, you can look at your local copy of wp-config, and see if this looks correct. If it looks garbled, I would start with a fresh clean copy of wp-config, and enter the correct remote values manually, then upload this.

    Thread Starter Bernardneo

    (@bernardneo)

    Both looks identical.

    Humm… Does the line 25 really refer to line 25? if it does, i just deleted it and retyped the whole line. It still have the same issue.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    If it’s a syntax error then it might be specific to line 25, or the line above/ below it.

    Thread Starter Bernardneo

    (@bernardneo)

    Ok. It looks identical. line 25 is the password line

    /** MySQL database username */
    define(‘DB_USER’, ‘[moderated]‘);

    /** MySQL database password */
    define(‘DB_PASSWORD’, ‘XXAAXX’);

    /** MySQL hostname */
    define(‘DB_HOST’, ‘localhost’);

    /** Database Charset to use in creating database tables. */
    define(‘DB_CHARSET’, ‘utf8’);

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    It’s very difficult to see because you didn’t wrap your code in backticks when posting, but it looks like you’re not using a proper apostophe here:

    define('DB_USER', ‘[moderated]');

    Thread Starter Bernardneo

    (@bernardneo)

    Thanks…Thanks… You nailed it for me….. Appreciate your help and keen eye.

    It is working now.

    Thanks Andrew.

    Thanks Rich.

    That’s great Bernardneo, and well done to Andrew for spotting the typo!
    Have fun with your site. ??

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Error Message after uploading to Host’ is closed to new replies.