Getting started with PHP: Essential dev tools

A complaint that I have with pretty much every programming language manual I’ve ever read, is that they almost never start by telling you how to get the tools you need. Sure, they tell you how to install the basic compiler or interpreter for the language, information you could easily discover by following the first Google result. But they don’t tell you where to find the tools that every experienced user knows about and uses every day, but which don’t come with the standard language distribution.

Today, as part of my ongoing notes on learning PHP, let’s talk about a few of those essential tools for PHP. I’m going to give Windows installation instructions, not because it’s my favorite, but because that’s the one platform most “how to install” pages seem to skimp on. If you’re on MacOS or Linux you should have no problem finding equivalent instructions.

Install PHP

First off, you need a PHP runtime. You can get this as part of an all-in-one package including a Web server, databasek, and the kitchen sink, such as XAMPP. But you don’t need all that just to start fiddling around code examples.

Using Chocolatey to install PHP is as simple as:

> choco install /y php

You should now have a command-line PHP executable.

> php -v
PHP 7.1.4 (cli) (built: Apr 11 2017 19:54:23) ( NTS MSVC14 (Visual C++ 2015) x64 )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies

Install Composer

Now you need a package manager in order to easily install open-source PHP libraries and tools. The de-facto PHP package manager is called composer. It is the equivalent to npm for JavaScript, Bundler for Ruby, or pip for Python.

> choco install /y composer

Install PsySH

The last tool you need to easily play around with PHP code is a decent REPL. Technically PHP comes with one, the -a option, but it’s not what I’d call decent. Instead, install PsySH.

> composer g require psy/psysh:@stable

On Windows you’ll probably need to start a new terminal window before you can use the psysh command.

> psysh
Psy Shell v0.8.3 (PHP 7.1.4 — cli) by Justin Hileman
>>> 1 + 1
=> 2


And that’s it for now: PHP, package manager, and REPL. If you know of any other “must-have” dev tools for PHP, let me know in the comments!


  1. Not on windows but hhvm has a very great hh_client which provides a nice way to get very good autocompletion type checking etc. Not pure PHP but nice to have during development either way I find.

Leave a Reply

Your email address will not be published. Required fields are marked *

Success message!
Warning message!
Error message!