4

I am installing on a local machine using localhost. I have a "learning" version of WordPress @ http://localhost/wordpress and I want to create another version of WordPress (@ http://localhost/jiewmeng) I want to test and maybe move to a real server later. I found that when I extracted a fresh copy of WordPress into localhost/jiewmeng, it probably detects the WordPress database and uses that? All the data I get is from the "learning" version of WordPress.

How do i set this up so that the 2 installations of WordPress are separate?

1 Answer 1

6

The database connection constants are defined in the wp-config.php file. Whether the 2 wp-config.php files in the jiewmeng directory and the WordPress directory are the same?

You need to create 2 different databases and set their constants in the respective wp-config.php files.

5
  • i actually just extracted a fresh wordpress for the localhost/jiewmeng version. it didnt even have a wp-config.php i tried to add 1 and change the database name, it still connects to the old localhost/wordpress install. i even tried renaming the database from wordpress to wordpress_old and try again, both installs fail as they tried to connect to the same database. the workaround i had was create a new vhost http://jiewmeng to host my 2nd wordpress and it works. curious to know why this happens tho
    – Jiew Meng
    Sep 12, 2010 at 3:10
  • 1
    I'd be curious to know what kind of a setup you're running on your local machine. What you're running into is a server configuration/administration issue ... not a WordPress issue. You can have two separate WordPress installations on the same server connect to different databases because you explicitly identify the database when you set up WordPress. If they're both pointing to the same DB, it's because either you told them to, or your server did ... WP doesn't do that on its own.
    – EAMann
    Sep 12, 2010 at 4:33
  • i didnt tell them to look at the same database so maybe the server did? i am running windows 7, apache, php 5.3.2, mysql, wordpress 3.0.1 ... what other info needed? btw, creating a new vhost doesn't help actually, now my old wordpress http://localhost/wordpress uses the data from my new wordpress http://jiewmeng ... also, i noticed that when i goto localhost/wordpress now, its using the data from jiewmeng and all links goes to jiewmeng...
    – Jiew Meng
    Sep 12, 2010 at 6:48
  • somehow it works now ... i dunno whats wrong with it lol ... maybe some browser cache or something ... if anyone happens to have the same issue or know whats wrong let me know
    – Jiew Meng
    Sep 12, 2010 at 7:46
  • @jiewmeng strange indeed. :)
    – Box
    Sep 13, 2010 at 0:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.