Just restart your server and then create webapplication, sitecollection; It will run. or follow the below steps:
Start Internet Information Services (IIS) Manager.
Right-click the Web site that contains the SharePoint Web site that you created, and then click Properties.
Click the Home Directory tab.
Under Application settings, click either Scripts only in the Execute permissions list or Scripts and Executables in the Execute permissions list (as appropriate to your situation). Click OK.
Quit IIS Manager.