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

Tried loading a Wordpress site locally using a MAMP serve, but I'm getting a HTTP 500. Would you mind helping me?

Hey I tried loading up a Wordpress repo I cloned which you can find here, on a MAMP server: http://foundationpress.olefredrik.com/

I'm not able to view the site locally as shown in the course itself: https://teamtreehouse.com/library/local-wordpress-development

I changed the default file path (which points to htdocs) to point to a custom file path in my directory, maybe that's a problem.

2 Answers

Samuel Glister
Samuel Glister
12,471 Points

Hello,

I develop with this theme all the time. It super simple to set up, below is a good guide to getting started on Mac in the same way I do it.

Assuming MAMP servers are started..

  1. Download wordpress from wordpress.org
  2. Create a directory in your htdocs, I'm going to use visionpro.co.uk as an example.
  3. Copy all of the files out of the wordpress zipped folder into your directory htdocs/visionpro.co.uk
  4. Download Foundationpress from the Github repo.
  5. Unzip Foundationpress then drag the folder into the theme directory (htdocs/visionpro.co.uk/wp-content/themes) then rename the folder to whatever you would like to call it, i'l call it vision-web
  6. Head to phpMyAdmin and create a database i will call mine vision.
  7. Go to your browser of choice and visit localhost/yoursite - so in my case i would visit localhost/visionpro.co.uk 8: Run the wordpress install
  8. Open up terminal and navigate to your theme folder so on my mac it would be 'cd Applications/MAMP/htdocs/visionpro.co.uk/wp-content/themes/vision-web' and press enter
  9. install npm by typing 'npm install' and pressing enter. Then let the install run.
  10. Start the watch by typing 'npm run watch' and pressing enter.
  11. Visit wp-admin and navigate to Appearance > themes then activate your new theme.
  12. Finally head over to settings > permalinks in wordpress and choose your desired option then save.

You can then begin editing your theme and making your new site.

I'm not saying the above is the best or easiest way of setting up that local environment but it definitely works for me.

I followed all your steps and the only thing that went astray was that the stylesheet didn't load up as it was supposed to, maybe I activated the theme and the scss wasn't compiled

That probably is the problem. htdocs is the root of your project. It contains your WP install, as well as the theme, and plugins. try to direct the MAMP file to htdocs, and you should be good to go.