0
votes

I am trying to run an azure app which use blob storage. I tried with the following sample kit: https://github.com/Interop-Bridges/Windows-Azure-Sample-Kit-4-PHP/tree/master/GuestBookUsingBlobs (I changed the storage account and key in index.php)

So my problem is that after I deploy this to azure I get 500 internal server error, however on localhost it works fine!

Whats wrong? Thank you!

(a simple phpinfo() file works fine in azure too)


    <?xml version="1.0"?>
<configuration>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
       <httpErrors errorMode="Detailed" />
    <asp scriptErrorSentToBrowser="true"/>
    <defaultDocument>
      <files>
        <clear/>
        <add value="index.php" />
      </files>
    </defaultDocument>
    <staticContent>
      <remove fileExtension=".svg" />
      <remove fileExtension=".eot" />
      <remove fileExtension=".woff" />
      <mimeMap fileExtension=".svg" mimeType="image/svg+xml"  />
      <mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
      <mimeMap fileExtension=".woff" mimeType="application/x-woff" />
    </staticContent>
  </system.webServer>
  <system.web>
    <customErrors mode="Off"/>
    <compilation debug="true"/>
</system.web>
</configuration>

above the changed web.config

I do the deploying with this: http://rhizohm.net/irhetoric/post/2011/04/18/How-To-Do-PHP-Deployment-To-Windows-Azure.aspx

1
You should take a look at the official PHP on Windows Azure tutorials put out by Microsoft. They show how to setup the SDK, run through sample projects, and how to deploy your app. azurephp.interoperabilitybridges.com/tutorials - Ben Lobaugh

1 Answers

0
votes

Based on what you have provided above I guess:

  1. You have a sample web page (xyz.php) which just have phpinfo() and it does works fine. Which indicate that your role does have PHP configured correctly.
  2. However the index.php which have the code which directly connect with your Azure Blob Storage does not work correctly.

To start investigation, i would say 500 Internal Server Error is a very generic error and you would have slim chance to investigate using this error. Here are couple of things to check in your code:

  • Are you using absolute path or relative path in your code? Please check index.php and where the form action is being submitted please verify that you do have proper relative path because on Azure VM, absolute path will not work
  • Have your enabled PHP error display using display_errors=On in PHP.ini
  • Please use this link to add custom error message in your code How to view actual error on Azure fastCGI?
  • IF you have ability to RDP to your Azure VM please log in and debug the PHP code directly on Azure VM instance
  • Finally IF you need assistance in RCA for your problem, please contact Azure Support team (24x7 via web or phone) at the link below and they will have ability to access your instance (with your permission) and provide you root cause.

https://support.microsoft.com/oas/default.aspx?gprid=14928&st=1&wfxredirect=1&sd=gn

When contacting Azure Support, please provide your Subscription ID, Deployment ID, your Azure Live Account ID and a small description of your problem.