1. Download and Install Visual C++
In order to run PHP on Windows 10, you will need to install Visual C++ Redistributable for Visual Studio. You can download it from the Windows Download page or click the direct link below. In most cases you will need the 64 bit version unless your PC is old, in which case you will need the 32 bit version.
Once downloaded, run the installer and click Install.
2. Download and Extract PHP
Go to the Windows PHP download page and download the .zip of the version of PHP you require. In this guide, we are installing PHP 7.4 VC15 x64 Non Thread Safe, which is the latest version as of writing (Jan 2020).
Once downloaded, create a new folder in
c:\php7 (or wherever you prefer) and extract your PHP zip to it.
3. Add Path Environment Variable
So that you don’t have to type the whole 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.
In System Properties, click Environment Variables.
In 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 dialogue by clicking OK.
If you have any Command Prompt windows currently open, close them now.
Open Command Prompt, type
php -v and press Enter. You should now see the PHP version.
4. Download and Install Composer
In the second step of Composer Setup, make sure the correct path to php.exe is set and click Next.
If Setup prompts to create php.ini, allow it and click Next.
Skip the Proxy URL settings, just click Next then click Install.
Click Finish once install is complete.
5. Test Composer
Open up Command Prompt and type
If all was installed correctly, you should see a version number.
Hurrah! You can now run Composer and PHP on Windows 10.
p.s. I increased my AdSense revenue by 68% using AI 🤖. Read my Ezoic review to find out how.