

You may need to accept a firewall exception before the server starts to run. Open a cmd command prompt ( not PowerShell) and start Apache with: cd C: \Apache24 \bin You’ll also need to install the Visual C++ Redistributable for Visual Studio 2015–2020 ( vc_redist_圆4) the page has a link at the top. To install Apache, download the latest Win64 ZIP file from and extract its Apache24 folder to the root of your C: drive.

Emulating that environment as closely as possible permits more advanced customization and should prevent development errors. You can then view PHP pages in a browser at This may be adequate for quick tests, but your live server will use Apache or similar web server software.

PHP provides a built-in web server, which you can launch by navigating to a folder and running the PHP executable with an -S parameter to set the localhost port. The following sections describe how to install Apache and PHP directly on Windows. Check out SitePoint’s article Setting Up a Modern PHP Development Environment with Docker for a complete guide to setting it up. Once you’ve installed Docker Desktop on Windows, it’s easy to download, configure, and run Apache and PHP.ĭocker is currently considered the best option for setting up a PHP development environment. Containers look like full Linux Virtual Machines but are considerably more lightweight. Using Dockerĭocker creates a wrapper (known as a container) around pre-configured application dependencies such as Apache, PHP, MySQL, MongoDB, and most other web software. You can install a variety of Linux distros, so refer to the appropriate Apache and PHP instructions. WSL2 is also a virtual machine, but it’s tightly integrated into Windows so activities such as file sharing and localhost resolution are seamless. Alternatively, distros such as Ubuntu Server provide them as standard (although they may not be the latest editions). You can install any version of Linux, then follow its Apache and PHP installation instructions. Microsoft Hyper-V (provided in Windows Professional) and VirtualBox are free hypervisors which emulate a PC so you can install another operating system. Installing Apache and PHP manually will help you learn more about the system and configuration options. These packages are easy to use, but they may not match your live server environment. These packages include XAMPP, WampServer and Web.Developer. They contain Apache, PHP, MySQL, and other useful dependencies in a single installation file. Before you jump in, there may be a simpler installation options… Using an all-in-one packageĪll-in-one packages are available for Windows.
