How to install php on Windows Server 2012

Installing PHP on Windows 2012 with Web Platform Installer

1. Open the Web Platform Installer from the following location on your filesystem:

C:\Program Files\Microsoft\Web Platform Installer\WebPlatformInstaller.exe

wpi
Note: If the Web Platform installer is not currently installed it can be downloaded via the following link: https://www.microsoft.com/web/downloads/platform.aspx

Then click the download to open the program.

2. Search for PHP.

wpi3

3. Select Add next to the version of PHP you wish to install and click Install.
wpiinstall

Domain, Public and Private Profiles in Windows 2008/2012 Firewall

Definition of profiles in Microsoft words:

Domain. Windows automatically identifies networks on which it can authenticate access to the domain controller for the domain to which the computer is joined in this category. No other networks can be placed in this category.

Public. Other than domain networks, all networks are initially categorized as public. Networks that represent direct connections to the Internet or are in public places, such as airports and coffee shops should be left public.

Private. A network will only be categorized as private if a user or application identifies the network as private. Only networks located behind a NAT device (preferably a hardware firewall) should be identified as private networks. Users will likely want to identify home or small business networks as private.

IIS7 deployment – duplicate ‘system.web.extensions/scripting/scriptResourceHandler’ section

The solution for me was to change the .NET framework version in the Application Pools from v4.0 to v2.0 for the Default App Pool:

apppool

21
down vote

If, like me, you need to target v4 but can only build with .net 3.5, follow the instruction here. Just replace in your web.config the whole content of the with:

<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
  <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
    <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
    <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions,  Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
      <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/>
      <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
      <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
      <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
    </sectionGroup>
  </sectionGroup>
</sectionGroup>

Change RDP Port Windows Server

Connect to your server via Remote Desktop
Click simultaneously on the Windows logo + R to open the “Run” dialog and execute the “cmd” command
Open the registry editor by typing the “regedit” command
Search for this registry subkey:


HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber

Double-click or right-click on the “PortNumber” registry subkey, select the decimal base and type the port number of your choice (the default port is 3389, in this example, we selected port 3390). Click on “Ok” to save your selection.
IMPORTANT: Make sure that remote access to your server through the new port is authorized in your Windows firewall before executing the next step.
Exit the registry editor
Restart your server

After the reboot, specify the Remote Desktop port number.

Resources:

http://www.techrepublic.com/blog/the-enterprise-cloud/changing-the-rdp-listening-port-on-windows-server/

Installing and Enabling IIS and FTP on Windows Server 2012

To install the role using PowerShell, use these steps. PowerShell must be run using Administrator rights. Installing IIS and all subfeatures can be run in 2 commands:

Import-module servermanager

Add-windowsfeature web-server –includeallsubfeature

iisimage001

To install the role using Server Manager, follow these steps:

Read moreInstalling and Enabling IIS and FTP on Windows Server 2012

RDP Logs

You should be able to check the Event Viewer and go through the Security section to see the Audit Successes and Failures for logins. If you are on the general tab, there is a box at the top (which you have to scroll through) that would say why it failed if it was a Failure and lower in that box it would say the source network address and the workstation name that was connecting.

Update:

To view the RDP logins:

Event Viewer > Applications and Services logs > Microsoft > Windows > TerminalServices-RemoteConnectionManager > Operational