

I manually edited the values with notepad but you could easily backup and then change the port with PowerShell copy "C:\tools\Apache\httpd-2.4.20\Apache24\conf\nf" "C:\tools\Apache\httpd-2.4.20\Apache24\conf\httpd_nf" I had to make this change on my system as another service was already using port 80 causing a conflict, I also had to specify the ServerRoot folder as an explicit path in the nf file as the relative path value in Windows 7 had prevented the Apache service from starting throwing a code 1 event error. Close/reopen your shell to see the changes (or in PowerShell just type refreshenv).īy default, Apache is installed to run from localhost:80 you can change this and other Apache settings in the nf file located at C:\tools\Apache\httpd-2.4.20\Apache24\conf\nf Let us start with noting that the Environment Vars (like PATH) have changed during the installs. Now that we have default latest AMP components installed we just need to link everything together. choco install apache-httpd -yĬhoco install php -y -params '"/ThreadSafe"' Step 3: Configuration Read more here about NTS vs TS PHP here and when to choose each.

Also note we have to install the ThreadSafe version of PHP and threadsafe versions of any PHP modules. We will also bypass the install questions with the -y flag to autoconfirm. To simplify things we are just going to install the latest versions and use choco install or the shortcut cinst. It just takes 3 more command line actions to install the AMP components. Note: if you install Chocolatey to the default install location, you will always have to run choco from an elevated prompt. Note: You must have your execution policy set to unrestricted (or at least in bypass) for this to work (Set-ExecutionPolicy Unrestricted) from administrator elevated PowerShell.Ĭlose and reopen your shell window and we are good to go. Note: Windows 10 comes with PowerShell 5.0 so there is no need to install or upgrade PowerShell to simplify the Chocolatey installation. I didn't have to worry about losing the PSModulePath customizations, so I just upgraded to PowerShell v5.1 via the Windows Management Framework 5.1. * (If you need to upgrade from PowerShell v2 on Windows 7 read this blog which notes some issues you might run into (and why Chocolatey would have made things a bit easier). Installing Chocolatey is a simple command line action from an administrative PowerShell v3+.* iwr -UseBasicParsing | iex Chocolatey is a lot like the Linux tool apt-get and makes installing and managing packages simple. Installing Amp on Windows can be a challenge at times, but thanks to Chocolatey: the package manager for Windows the whole process is a lot simpler.

This is a guest blog post by Walt Sorensen.
