Magento on Windows can be opened for local debugging, but Adobe does not support Microsoft Windows or macOS. The supported operating systems are Linux x86-64. The errors below are what native Windows PHP reports when a Magento command expects Unix functions or a PHP extension that this php.ini never loaded.
Use Windows Subsystem for Linux when the shop has to match production. Stay on native PHP only when you are isolating one extension error and you accept that bin/magento will keep hitting Unix-only code.
PHP Fatal error: Uncaught Error: Call to undefined function posix_geteuid()
Undefined constant "Magento\Framework\Encryption\Adapter\SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES"
Error: Call to undefined function curl_init()
Failed to extract <package>: 7z.EXE

A missing theme_dir, a theme that cannot be selected, and bin/magento disappearing after generated/ was deleted by hand belong to the same local install, but the static-content half is covered in the generated-code guide.
Windows almost always has two configs: one for php.exe and one for Apache or nginx. A change in the XAMPP Control Panel file does nothing for Composer.
php -v
php --ini
php -m
In the module list, look for curl, sodium, intl, gd, mbstring, soap, xsl, zip, and bcmath. Magento’s installer checks these. posix will not appear. PHP’s POSIX manual says that extension is not available on Windows.
bin/magento calls posix_geteuid() near the top of the file so it can refuse to run as root on Linux. On Windows the function does not exist, so the CLI dies before any Magento command runs.
Do not invent a php_posix.dll. There is no supported Windows build. Two practical choices:
bin/magento that you do not commit and do not deploy. Production code should keep the root check.A guard looks like this:
if (function_exists('posix_geteuid') && posix_geteuid() === 0) {
exit('bin/magento cannot run as root.' . PHP_EOL);
}
That gets you past this one line. Later commands still call other Unix tools (bash, tar, symlink behavior). Treat it as a temporary bridge, not a supported install.
Magento’s encryptor reads SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES from the sodium extension. If the extension is not loaded, PHP 8 reports an undefined constant inside Magento\Framework\Encryption\Adapter\SodiumChachaIetf.
Replacing the PHP folder with another version does not help when the new folder also has sodium commented out, or when Apache is still using the old php.ini.
php --ini, not a second copy you found by search.extension=sodium. On Windows the matching DLL is php_sodium.dll, and libsodium.dll must be somewhere Apache can load. Copying libsodium.dll from the PHP directory into apache\bin is the usual XAMPP step when Apache says the module cannot be found.phpinfo() page must list sodium. CLI success alone does not fix the storefront.Imagick failing to load after a PHP swap is a separate binary mismatch: the Imagick DLL was built for a different PHP version. Disable that line until you have a DLL built for this exact PHP version. Magento does not need Imagick for the sodium error.
Call to undefined function curl_init() means ext-curl is not loaded in the PHP process that hit the line. Mailchimp, Guzzle, and repo.magento.com all need it.
php -m | findstr /i curl
Enable extension=curl in the same php.ini the failing process uses, restart that process, and run php -m again. Prefer curl over turning on allow_url_fopen. The Guzzle-specific case is its own solution.
On Windows, Composer shells out to 7-Zip when it cannot use unzip. Failed to extract ... 7z.EXE usually means the path is too long, 7-Zip is not the version Composer expects, or the archive is locked by antivirus.
C:\src\shop, not a deep folder under a user profile.unzip/7z path only after composer diagnose shows the current choice.Do not delete vendor/ on a shop you cannot reinstall. composer install needs composer.lock and access to repo.magento.com.
/mnt/c.localhost and 127.0.0.1 breaks admin static files.php -m shows sodium and curl for both CLI and the web server.php bin/magento --version prints a Magento version instead of a PHP fatal.var/log/exception.log.php.ini. Compare php --ini with the “Loaded Configuration File” line in phpinfo().No. The system requirements list Linux x86-64. Windows and macOS are not supported. WSL is the practical local environment when the shop has to match production.
No. PHP's POSIX extension is not available on Windows. Guarding the one posix_geteuid call is a temporary local bridge, not a supported install.
CLI and Apache often load different ini files. Check phpinfo for the web SAPI and php --ini for the command line.