Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To install Composer on Windows 10 or 11, first make sure PHP runs from a terminal, then download and run the official Composer-Setup.exe. Open a new terminal afterward and verify both commands with php --version and composer --version.

Before you install Composer

Composer manages dependencies for PHP projects, so the PHP command-line runtime must be available on your computer. If PHP is not installed, use the PHP manual’s Windows installation instructions. The PHP documentation recommends official Windows releases for production use.

Before continuing, open Command Prompt or PowerShell and run:

php --version

If Windows reports that php is not recognized, set up PHP’s command-line PATH first. The PHP executable’s folder—not the executable file itself—belongs in PATH. Follow the PHP Windows command-line guidance and add the folder to the existing PATH value. Do not replace PATH or PATHEXT, since other software may depend on their existing entries.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install Composer with the Windows installer

  1. Open the official Composer Windows installation page and download Composer-Setup.exe. Composer describes this as the easiest way to set up Composer on a Windows machine.
  2. Run Composer-Setup.exe and follow its prompts. The installer sets up Composer for command-line use, including its PATH entry.
  3. When setup finishes, close any Command Prompt or PowerShell windows that were already open. Start a fresh terminal; PATH is read when a terminal starts.
  4. Check the PHP and Composer commands:

php --version
composer --version

Each command should print version information. If both do, Composer is ready to run from the command line.

Fix “command is not recognized” errors

Windows does not recognize php

  • Confirm PHP is installed and identify the folder containing php.exe.
  • Ensure that folder is included in the existing Windows PATH value. PHP’s command-line setup documentation explains the configuration.
  • Close the terminal, open a new one, and retry php --version.

Windows does not recognize composer

  • Confirm the Composer installer completed successfully and that its PATH setup is present.
  • Open a new terminal and retry composer --version.
  • If the command is still unavailable, rerun or repair the official Composer Windows setup as appropriate.

Run Composer’s diagnostic command

If Composer starts but reports a setup problem, run:

composer diagnose

Composer recommends this command for diagnosing common issues. For the specific Windows error “The system cannot find the path specified,” its troubleshooting guide says an invalid path in a Command Processor AutoRun registry entry can be a cause. Check the registry entries described in that guide only if you encounter that error.

Use the current official download instructions

Composer’s release information and installer checks change over time. Use the official download page for the current release and any manual-installation instructions. Its manual procedure includes checking the installer script with a SHA-384 hash; the example is version-specific, so use the current instructions and checksum rather than an old copied value. The Windows setup executable is the straightforward route for most users because it handles Windows command-line setup.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What happens when you install project dependencies?

Installing Composer sets up the dependency manager; it does not install a particular project’s packages. In a project directory, Composer’s install command reads composer.json. If the project has a composer.lock file, Composer installs the exact versions recorded there. If there is no lock file, Composer resolves dependencies and creates one. See the Composer CLI documentation for command details.

Avoid treating options that ignore platform requirements as a routine fix for dependency errors. They can force installation even when the local PHP version, a library, or an extension does not meet the project’s requirements.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.