Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Tata Cheng
Tata Cheng
8,787 Points

Installing wordpress for every new site on localhost?

I've Googled and looked on a few forums, but I'm still a little confused. Hope someone can clear this up for me.

Do I have to install Wordpress on localhost every time I want to start a new site? I know I have to create a new folder in htdoc. Or can I use the Wordpress previously installed but just create a new database for it?

2 Answers

Matt Campbell
Matt Campbell
9,767 Points

You'll need to copy the wordpress files into each new directory. Each directory you create in your local htdocs needs to be treated as if it was on a completely separate server. You can use one database for all the different installs though. You'll need to prefix the tables with a different prefix, handled in the installation of WordPress, but I don't recommend doing that as you should be mirroring what will be loaded to your server so, separate database for each install. Then prefix can stay as default wp_ and moving and installing stays simple.

Tata Cheng
Tata Cheng
8,787 Points

Alrighty thanks for helping out, I'll do separate databases for each install :)

Leslie Hui
Leslie Hui
3,330 Points

if you don't want to have multiple installation of Wordpress, you can try Wordpress Multisite. You can follow the installation here

Tata Cheng
Tata Cheng
8,787 Points

Unfortunately I'm working on a pc using xampp... so I guess I can't install that one :/ Thanks though, I'll keep that in mind if I change over to mac

Leslie Hui
Leslie Hui
3,330 Points

If you are using windows, it's still possible. Follow the guide here. :)

Tata Cheng
Tata Cheng
8,787 Points

Thanks so much Leslie!! :D