Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP PHP Basics Getting to Know PHP Intro to Workspaces and PHP Code

adhitya ram
adhitya ram
1,636 Points

how do i run php programme on my computer?

php installation

3 Answers

Php 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.

Hi 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.