Install PHP 8.4 on Windows (and keep other versions)
windows.php.net ships PHP 8.4 as a zip, not an installer, and gives you four builds to choose from. Picking the right one, installing the Visual C++ runtime it needs, writing a php.ini with the extensions most frameworks expect and putting it on PATH takes about fifteen minutes. These steps cover the manual route, how to keep older versions next to 8.4, and how EnvKit does the same from its PHP page.
- Platform
- Windows 10/11 (x64)
- Time
- About 15 minutes
- You need
- 64-bit Windows 10 or 11
- Administrator permission once, for the Visual C++ runtime
PHP 8.4 Windows builds from windows.php.net; EnvKit details checked against 0.33.0-beta.56 on 2026-10-29.
Step 1: Pick the right build
On windows.php.net, take the x64 zip for PHP 8.4. Thread Safe (TS) is only for running PHP inside Apache as a module (
php8apache2_4.dll), and then Apache must be a VS17 x64 build such as Apache Lounge’s. For everything else (the command line, Composer, nginx or IIS through FastCGI, Apache withmod_fcgid) take Non Thread Safe (NTS).Step 2: Install the Visual C++ runtime
PHP 8.4 for Windows is built with Visual Studio 2022 (VS17) and needs the Microsoft Visual C++ 2015–2022 Redistributable (x64). Without it PHP stops with “VCRUNTIME140.dll was not found”. With an outdated copy it prints that
VCRUNTIME140.dllis not compatible with this PHP build. Install the latestvc_redist.x64.exefrom Microsoft in both cases.Step 3: Unzip PHP and create php.ini
Extract the zip to a short path without spaces, such as
C:\php84. Copyphp.ini-developmenttophp.iniin the same folder; the development defaults show errors on screen, which is what you want locally.In
php.ini, setextension_dirto the full path of theextfolder (a relative path breaks when PHP runs from another folder) and remove the;in front of the extensions you need. The list below covers Laravel, WordPress and Composer.C:\php84\php.ini extension_dir = "C:\php84\ext" extension=curl extension=fileinfo extension=gd extension=intl extension=mbstring extension=mysqli extension=openssl extension=pdo_mysql extension=pdo_sqlite extension=sqlite3 extension=zip date.timezone = UTCStep 4: Add PHP to PATH and check it
Add
C:\php84to your user Path (Start → “Edit environment variables for your account” → Path → Edit → New), then open a new terminal.php -vshould print 8.4,php --inishould showC:\php84\php.ini, andphp -mlists the loaded extensions.Command Prompt or PowerShell php -v php --ini php -mStep 5: Keep other versions next to it
Unzip each version into its own folder (
C:\php83,C:\php74) with its ownphp.ini. Only one of them can be plainphpon PATH. For the others, put small launchers in a folder that is on PATH, one per version, sophp83 artisan migrateruns PHP 8.3.For a web server, run one
php-cgi.exeper version on its own port (for exampleC:\php83\php-cgi.exe -b 127.0.0.1:9083) and point each site’s FastCGI setting at the port of the version it needs.php83.bat @"C:\php83\php.exe" %*Step 6: Or install PHP 8.4 with EnvKit
EnvKit is a free app that installs PHP versions, Composer, a web server and databases, and keeps each PHP version in its own folder.
Or install from the terminalirm https://envkit.net/install.ps1?c=guide-install-php-8-4-windows | iexStep 7: What EnvKit sets up for you
Open Services → PHP, pick the 8.4 build under Install & versions and click Install. EnvKit lists the official Windows builds from windows.php.net (NTS x64), one current release per line from 7.4 to 8.5. Before installing it checks the Visual C++ runtime and installs Microsoft’s redistributable if it is missing or too old, which asks for permission once.
Each version gets its own
php.ini, created fromphp.ini-developmentwithextension_dirset, an error log you can read on the Logs page, 1024M upload, post and memory limits, and curl, exif, fileinfo, gd, intl, mbstring, mysqli, openssl, pdo_mysql, pdo_pgsql, pdo_sqlite, sqlite3 and zip turned on. Other extensions are on the version’s Extensions tab.Nothing goes on PATH until you tick it under Tools → Environment (PATH). With PHP version + ini launchers ticked,
phpis your default version andphp84,php83and so on call each installed version. Pinning a version to one site is covered in the multiple PHP versions guide.
If something goes wrong
- “PHP Warning: Unable to load dynamic library”
- The
extension_diris wrong or relative, or the extension’s DLL is not inext. Use the full path, and check that the file (for examplephp_intl.dll) is there. - Apache will not load php8apache2_4.dll
- The module needs the Thread Safe build and an Apache built with the same compiler (VS17, x64). Mixing an NTS zip or an older Apache build fails to load. Running PHP through FastCGI avoids the match entirely.
php -vstill shows the old version- Another PHP folder comes earlier in PATH, often from XAMPP or Laragon in the system PATH. Run
where.exe php, remove or reorder the older entry, and open a new terminal.