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

James Ingmire
James Ingmire
11,901 Points

Need to edit live Wordpress Site, how to edit offline?

I have been asked to add a few things to a site, it uses wordpress so this is new to me.

I would normally download the site via ftp and then I can edit files and view the changes in browser offline ready to upload via ftp again.

How do I do the same with this wordpress site, as when I try to run it on a local host is says "Error establishing a database connection".

Many thanks :)

1 Answer

Maor Tzabari
Maor Tzabari
1,762 Points

Since it's not a simple HTML website and you are dealing with PHP, You have to install a server environment like wamp or xampp . <br/> After you install that you'll have a directory of www, that will be the location of your projects. this is your main URL that you can see all of your projects: http://localhost/ or http://127.0.0.1/

so if for example you have a project folder of the name Project1, you should enter in your browser the url: http://localhost/Project1/

You still might not see your wordpress project after that because you will have to download the database from you online server to you localhost, that means you should go to the phpMyAdmin at your online server, find your database and export it, it will export it as an SQL file, after you have this file you should go to you localhost phpMyAdmin and import this file that you've download.