Support » Localhost Installs » access to localhost copy site

  • I made a mistake when trying to rename a localhost site copy where I had been updating my work. I went to General Settings and put the original name of the site in the URL’s fields. Since the site already existed, it is redirecting me to that old site. Then I tried to override that by adding two instruction lines manually to the wp-config.php file of the copy site folder. The instructions read the HOME and SITEURL new addresses, in which I use ‘http://localhost/sitename.dev.cc’ for both. Now it goes there and reads this instruction and produces a syntax error message which reads that it does not like ‘:’ and that it was expecting ‘)’. Is there anyone who has any idea of what is this? I have double checked every character typed and it is exact to the instructions found. There is no typing mistake. Thank you.

Viewing 6 replies - 1 through 6 (of 6 total)
  • 1) Copy and paste here the EXACT lines of code you added to your wp-config.php file. Be sure to copy what you have already added to wp-config.php file, not what is on the instructions page. And please be sure to use the “CODE” formatting button when pasting your code here, so the forum software doesn’t mangle your code.

    2) Please provide a FULL PAGE Screenshot of the error message you’re suing. Upload your screenshot to snipboard.io or imgur.com, and share the link here.

    Standing by to help troubleshoot this.

    Thread Starter totl99

    (@totl99)

    Follow the two lines added:

    Define( ‘WP_HOME’, ‘http://localhost/sitename-copy.dev.cc’ );
    Define( ‘WP_SITEURL’, ‘http://localhost/sitename-copy.dev.cc’ );

    I copied-pasted the line of the error here (is on top of screen of the macbook, red color background), since the rest of the page is totally blank. I do not have snipboard nor ingur. Line 22 is the first line out of the two added to wp-config.php and posted above. The error reads as follows:

    ( ! ) Parse error: syntax error, unexpected ‘:’, expecting ‘)’ in /Users/campanita/Sites/www.sitename-copy.dev.cc/wp-config.php on line 22

    Thank you for your help.

    Define( ‘WP_HOME’, ‘http://localhost/sitename-copy.dev.cc’ );
    Define( ‘WP_SITEURL’, ‘http://localhost/sitename-copy.dev.cc’ );

    If you copied the above EXACTLY from your wp-config.php file, then you have the ‘wrong’ single quote.

    KIndly try this instead:

    Define( 'WP_HOME', 'http://localhost/sitename-copy.dev.cc' );
    Define( 'WP_SITEURL', 'http://localhost/sitename-copy.dev.cc' );
    Thread Starter totl99

    (@totl99)

    Thank you much. I tried what you suggested but it did not work. I decided to try taking http:/ away and I re-typed the two lines as follows

    Lines 21 and 22:
    Define( ‘WP_HOME’, ‘/localhost/sitename-copy.dev.cc’ );
    Define( ‘WP_SITEURL’, ‘sitename-copy.dev.cc’ );

    And it went on, not detecting any problems with the added lines (please notice line 21 includes /localhost/ whereas line 22 does not). Still, it detected a problem on line 26, a line that has not been modified at all.

    ( ! ) Parse error: syntax error, unexpected ” ); ‘ (T_CONSTANT_ENCAPSED_STRING), expecting ‘)’ in /Users/campanita/Sites/www.sitename-copy.dev.cc/wp-config.php on line 26

    This is Line 26:
    define(‘DB_NAME’, ‘sitenameDBtswys’);

    The site (sitename-copy.dev.cc) was working fine until I redirected it by changing the URL names. There is no reason for any instruction that was there before I made the change, to be wrongly typed. There must be something related to the lines added, because I returned to include /localhost/ in line 22 and it gave me again error message in line 22. Then, I erased it from the line to go back to the format previously passed without error, but it continues producing the following error

    ( ! ) Parse error: syntax error, unexpected ‘Define’ (T_STRING), expecting ‘)’ in /Users/campanita/Sites/www.sitename-copy.dev.cc/wp-config.php on line 22

    Please observe the error is on line 22 and not 21, the first line added.
    I have two questions: 1- What is the 2nd added line doing? 2- What does the Server do when I normally enter to visit or edit my site and WordPress asks me for my username and password? In other words, what does WordPress control and/or do in that moment, if this is a localhost development? Thank you very much.

    Thread Starter totl99

    (@totl99)

    It has been 2 days since I posted the last changes and results to the config file, trying to resolve this problem, but there is no single reply so far. I will very much appreciate if someone can help me by sharing his(her) knowledge and experience with a similar problem and let me know what seems to be happening and what situation may be creating the error messages. Thank you.

    Thread Starter totl99

    (@totl99)

    Hello George @gappiah,
    I appreciate your previous suggestions. Nothing tried is working so far. I wonder why the wp-config.php does not like the 2 suggested added lines. It does not matter if the lines positioned at the beginning or at the end of the wp-config.php list of instructions. It seems like the first additional line would not be completed properly and I want to use define in the next line, but the program sees it as part of the same line, therefore it produces a syntax error. Is there a particular way to direct the URL for a localhost site?, why would it be that the added instructions are as suggested but they are not accepted? Thank you.

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