Install PHP from prebuilt packages on Windows with Apache HTTP server and MongoDB

On Windows there are multiple ways to install the latest, stable PHP. This guide will cover the most useful ways to get up and running fast.

Official Windows binaries maintains Windows binaries available for download at This is what you want to get a simple and working latest PHP installation on Windows.


Install Apache HTTP server

Install MongoDB

Install Composer

Composer is a de-facto standard manager for installing libraries, frameworks, and similar packages for your PHP applications. You will need to have it as well sooner or later if you haven't used it before.

Go to the download page and download the Composer-Setup.exe installer.

The Composer Setup options provide to install it without additional uninstaller for development purposes of Composer itself. At this stage you don't need to select the Developer mode:

Composer checking CLI

The installer will check some PHP settings for you:

Composer checking PHP settings

First check is to see if PHP can be run from the command line interface (CLI):

Composer checking CLI

In case you're using proxy to connect to internet, enter it here:

Composer proxy

After Composer is installed, you will need to close any command line windows or open a new one so you can fully use it.

Composer info

Click Next.

Composer should now be fully installed on your Windows system:

Composer completing

To check if installation is successful, open the command line and run the composer about or just composer to see if the command produceces any output:

Composer CMD

Development on localhost using built-in web server

If you're developing PHP applications on your local workstation, PHP also has a useful built-in web server for localhost development. It is not intended to be used for production environments.

Inside your project folder you can run it from the command line using PHP CLI SAPI:

php -S localhost:8000

Visit http://localhost:8000/ in your browser to access it.