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

PHP

How to run PHP on windows

I am now learning PHP and I used to download the files and use my own text editor. But the PHP is not working in command prompt.

1 Answer

Jason Cook
Jason Cook
11,403 Points

I think the best way to answer this question (regarding how to get started developing in PHP on a Windows workstation), would be to break it down into a couple areas: 1) development environment and 2) IDEs/text editors.

The following information pertains to developing in PHP in the Windows enviroment, however, some of the tools mentioned have versions available for MacOS as well. I'll point this out where possible.

1) First, you'll want to setup a suitable development environment. When developing on a Windows computer, I personally use XAMPP from Apache Friends (URL below). This is a completely free, easy to install Apache distribution containing MariaDB, PHP, and Perl. The XAMPP open source package has been set up to be incredibly easy to install and to use (quoting directly from the XAMPP website, which agrees with my experience using it).

This is also one of the most (if not the most) popular packages in use, currently. I use Apache HTTPD, PHP, MySQL, and many of the other modules for various products. Sometimes, you'll need to make slight modifications to the configuration files (e.g. .conf and .ini files) for the modules, but there is plenty of help available online for any snags you might encounter.

Link to Apache Friends XAMPP page

Note: If someone reading this is using MacOS, you can check out MAMP, at the following URL to get a similar type of development environment.

2) IDE (Integrated Development Enviroment) / Text Editors The next choice you'll have to make is whether to use a full blown IDE (such as JetBrains PhpStorm), or a less integrated but perhaps sophisticated text editor offering markup, prose, some intellisense, and relevant customization such as Sublime Text (URL to follow). Lastly, you might even find good use with a completely free option, such as Notepad++ which I personally use all the time. In fact, I use a color scheme for Notepad++ that gives a nice darker background with markup relevant to the type of file I'm editing (PHP, JavaScript, etc.).

Links to these tools

Also, don't forget to check the Treehouse Student Perks page, to see if any offers are available related to your needs. You can find this information at the URL, below.

Treehouse Student Perks

I hope this helps! Happy coding! :-)

Jason Cook