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 trial3 Answers
Lewis Marshall
22,673 PointsThere's 2 workshops by Alena to setup a local host with MAMP for MAC and Windows:
MAC: https://teamtreehouse.com/library/mac-local-php-dev-environment
Windows: https://teamtreehouse.com/library/setup-your-local-development-environment
Amitesh Singh Baghel
2,256 PointsPhp is server side scripting language, you can't run it normally like HTML,CSS. Download Xampp, download the version depending on your type of Operating System. Then, you run the xampp. As soon as u install and run Xampp. A control panel will open of Xampp. Switch on Apache, MySql( I mean to say click the start button). Then after it shows the status running, click mycomputer or whatever it is in your desktop. Open Xampp folder in C drive, in Xampp folder you will find another folder called htdocs. Open it, all the php programs will be written here. After creating a program like for example hello world. You will open your browser. You will type in the search bar "https://localhost/helloworld.php" then click enter.
Emil Pesaxov
3,684 PointsHi Adhitya, If you do not work with Treehouse's workspace console, it is essential that you will download a web server program such as Xampp. This will include within it Apache and MySQL to work with databases later. To view your PHP code you will then have to access to your localhost and the name of the file. For example, if your port is 80 then you need to type in the browser localhost:80/1.php
Pay attention that if you name your file 'index.php' it will not display it in the localhost with the rest of your files and you will have to type it manually in the browser.