Fijjit
Fijjit

Reputation: 1467

Why does my php file download instead of execute on Windows Azure?

I am trying to setup Wordpress in a subfolder (/blog) on my ASP.Net MVC app that is hosted on Windows Azure. When I navigate to /blog/index.php, the file downloads instead of executing.

I have done the following:

I've clicked Restart in the portal for the web app.

Still downloads the file instead of executing.

What am I doing wrong?

Upvotes: 0

Views: 1240

Answers (3)

Fijjit
Fijjit

Reputation: 1467

Well, turns out that we had a BlockViewHandler sitting in our web.config, which was blocking access to all file types (including .php). This might be unusual, but I'm posting this in case it helps someone else.

The tag we had was:

<handlers>
 <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>

It is designed to prevent unauthorised/hacking access.

Upvotes: 0

Zain Rizvi
Zain Rizvi

Reputation: 24636

Assuming you're running the site in an Azure Web App, verify that PHP is turned on: Go to the site in the portal -> Settings -> Application Settings -> PHP version

http://azure.microsoft.com/en-us/documentation/articles/web-sites-php-configure/

Upvotes: 0

Misunderstood
Misunderstood

Reputation: 5665

YOU need to add a Handler Mapping

I am not familiar with Azure, but...

You should have a IIS control panel with a Handler Mappings icon.

Add a Mapping Handler:

enter image description here

Upvotes: 1

Related Questions