This tutorial is about How to Install PHP Composer on Windows 11/10 PC. We will try our best so that you understand this guide. I hope you like this blog, How to Install PHP Composer on Windows 11/10 PC. If your answer is yes, please do share after reading this.
So lets keep reading for intertesting info:
Check How to Install PHP Composer on Windows 11/10 PC
Dependency management is one of the most important aspects of programming software with reusable packages, libraries, and modules. Almost all popular programming languages support dependency management tools to manage project dependencies. We can manage project dependencies in PHP using Composer.
In this tutorial, we will describe all the steps required to install Composer on Windows 10. The steps should be similar for other versions of Windows. It is assumed that PHP is already installed on the system. You can also follow how to install PHP 7 on Windows.
Composer makes it easy to access such packages and libraries. By default, a package repository called Packagist is used for this purpose. It combines multiple PHP packages and makes them available to the Composer package management program.
How to install PHP Composer on Windows 11/10 PC
Download and install Visual C++
To run PHP on Windows 10, you’ll need to install the Visual C++ Redistributable for Visual Studio. You can download it from the Windows download page or click the direct link below.
- Download: VC_redist.x64.exe (64-bit) or VC_redist.x86.exe (32-bit)
Once downloaded, run the installer and click Install.
Download and Extract PHP
Go to the Windows PHP download page and download the .zip of the version of PHP you need. In this guide, we are installing PHP 7.4 VC15 x64 Non Thread Safe, which is the latest version at the time of writing (Jan 2020).
Once downloaded, create a new folder in c:php7 (or wherever you prefer) and extract your PHP zip into it.
Download and Install Composer
- Download Composer-Setup.exe from the Composer download page
- In the second step of Composer setup, make sure the correct path to php.exe is set and click Next.
- If the installation program asks you to create php.ini, allow it and click Next.
- Skip proxy URL setup, just click Next and then Install.
- Click Finish once the installation is complete.
Test PHP
If you have any Command Prompt windows currently open, close them now.
- Open the command prompt, type php -v and press Enter. You should now see the PHP version.
- If it returns a version of PHP, you can skip to Step 6 to test Composer.
Add path environment variable
- The composer setup usually does this for you, but if for some reason it doesn’t, you can set one up manually.
- So that you don’t have to type the full path to php.exe every time you run a PHP command, you should add c:php7 as a path environment variable.
- Open System Properties by clicking the start menu and typing sysdm.cpl and press Enter.
- Under System Properties, click Environment Variables.
- Under System Variables, click Path, and then click Edit.
- Click New, type the path to your PHP folder (c:php7) and click OK.
- Close the System Properties dialog box by clicking OK.
test composer
- Open the command prompt and type composer -V (which is uppercase V).
- If everything installed successfully, you should see a version number.
- Hurrah! You can now run Composer and PHP on Windows 10.
Final words: How to Install PHP Composer on Windows 11/10 PC
I hope you understand this article, How to Install PHP Composer on Windows 11/10 PC. If your answer is no, you can ask anything via the contact forum section related to this article. And if your answer is yes, please share this article with your friends and family to give us your support.