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 trialIlonka Hofmann
4,916 PointsBuilding Websites with PHP course: Local wamp workspace setup
I've installed composer on my local server and created the composer.json file as per the lesson. Using command prompt, it saved to 'user/name' on my hard drive along with all the other files created so far. I've moved all the files to my local server in a new folder for this php project in wamp/www/newproject. Now I can't see my local work in my browser using localhost because I don't know how to properly reference the location inside my php file (I think thats what I need to do??) I just downloaded Twig (further in the lesson) and all the Composer files have recreated in the 'user/name' folder
6 Answers
Ted Sumner
Courses Plus Student 17,967 PointsOpen the command prompt and change the directory of the command prompt to your project folder. Then type in the composer init command when the command line is in your project root directory.
Ted Sumner
Courses Plus Student 17,967 PointsIt belongs in the root of your project. However, I don't recall actually creating one. When you include something like slim I believe it creates one for you.
Ilonka Hofmann
4,916 PointsI've rephrased my question to make it more clear
Ted Sumner
Courses Plus Student 17,967 PointsI don't use WAMP, so I don't know if the www folder is correct, but if it is, then you probably need to enter http://localhost.newproject
The WAMP docs will tell you the root folder. In XAMPP it is htdocs.
Ilonka Hofmann
4,916 Pointsyes I need to change the location it saves to but don't know how... I think maybe I need to edit the location using a command such as composer config, but that didn't work
Ted Sumner
Courses Plus Student 17,967 PointsWhat system are you using?
Ilonka Hofmann
4,916 PointsWindows 7
Ted Sumner
Courses Plus Student 17,967 PointsIlonka Hofmann
4,916 PointsForbidden
You don't have permission to access /newproject on this server. Apache/2.4.9 (Win64) PHP/5.5.12 Server at localhost Port 80
Ted Sumner
Courses Plus Student 17,967 PointsI did not have these problems when I was using XAMPP on windows 7. I now use Linux so I had to create the permissions to access files for XAMPP. Are you running as Admin? If not, you may try that.
Ilonka Hofmann
4,916 Pointsthanks Ted, I've installed XAMPP now and it's working:)
Ilonka Hofmann
4,916 PointsIlonka Hofmann
4,916 PointsI've got command prompt saving to the right folder which is great, any idea how to view the project in my browser? http://www.localhost.newproject/ & http://www.localhost.com/newproject doesn't work (server not found). I've tried all the folder directory combinations, actual filepath is: C:\wamp\www\newproject This path: http://localhost/www/newproject gives a different error message: Forbidden You don't have permission to access /www/newproject on this server. Apache/2.4.9 (Win64) PHP/5.5.12 Server at localhost Port 80
Ted Sumner
Courses Plus Student 17,967 PointsTed Sumner
Courses Plus Student 17,967 PointsHttp://localhost/projectFolder