none
PHP Deployment - Troubleshooting

    Question

  • Hi All,

    Apologies for what might be a newbie question. I have followed the various tutorials and blogs to develop and deploy a small test PHP application. The application runs fine on my machine in the dev fabric, but not when I deploy it. The static front page is fine, but for the other pages I get a 500 - Internal Server Error message.

    My question is, how can I investigate this further to find out what the problem is? A search around suggests that you used to be able to copy logs to blob storage, but I can't find anything to get me started now.

    Any suggestions would be gratefully received.

    Thanks,

    Steph

    Thursday, May 12, 2011 10:42 AM

Answers

  • Steph-

    One thing to check is that all paths in your php.ini file are relative paths (extension_dir, include_path, etc.). I've found that with absolute paths, an app runs fine in the dev fabric, but not when you deploy it.

    If that's not the problem, let me know...I'll have to think about how to capture log information.

    Hope that helps.

    -Brian

    Edit: In lieu of writing PHP errors to a file or blob, you could just display errors on your pages (since you are just testing, this should be OK). Adding something like this to your scripts will display errors:

    error_reporting(E_ALL);
    ini_set('display_errors', 'On');
    

     And, you can update these setting without redeploying...details here: http://blogs.msdn.com/b/brian_swan/archive/2011/04/11/updating-php-settings-in-windows-azure.aspx.


    This posting is provided "AS IS" with no warranties, and confers no rights. http://blogs.msdn.com/brian_swan
    • Marked as answer by Wenchao Zeng Thursday, May 19, 2011 6:44 AM
    Thursday, May 12, 2011 3:25 PM

All replies

  • Steph-

    One thing to check is that all paths in your php.ini file are relative paths (extension_dir, include_path, etc.). I've found that with absolute paths, an app runs fine in the dev fabric, but not when you deploy it.

    If that's not the problem, let me know...I'll have to think about how to capture log information.

    Hope that helps.

    -Brian

    Edit: In lieu of writing PHP errors to a file or blob, you could just display errors on your pages (since you are just testing, this should be OK). Adding something like this to your scripts will display errors:

    error_reporting(E_ALL);
    ini_set('display_errors', 'On');
    

     And, you can update these setting without redeploying...details here: http://blogs.msdn.com/b/brian_swan/archive/2011/04/11/updating-php-settings-in-windows-azure.aspx.


    This posting is provided "AS IS" with no warranties, and confers no rights. http://blogs.msdn.com/brian_swan
    • Marked as answer by Wenchao Zeng Thursday, May 19, 2011 6:44 AM
    Thursday, May 12, 2011 3:25 PM
  • Brian,

    I have applied those settings but it doesn't seem like there is any output to the screen and it looks like the error pages in the FTP directory are still just the generic 500 errors.  Is there any way to turn on errors so they are just output to the screen like on a linux deployment?


    Mike Borozdin - DocuSign Professional Services

    Friday, June 22, 2012 8:29 PM
  • Have you tried turning on detailed errors in the web.config file that is deployed with your application?

    <configuration>
       <system.webServer>
          <httpErrors errorMode="Detailed" />
       </system.webServer>
    </configuration>

    -Brian


    This posting is provided "AS IS" with no warranties, and confers no rights. http://blogs.msdn.com/brian_swan

    Wednesday, June 27, 2012 8:09 PM
  • I just ported that app from a Linux machine and I am deploying using Git.  Should I create a web.config file?  Web.config is a .NET artifact...

    Mike Borozdin - DocuSign

    Wednesday, June 27, 2012 9:49 PM
  • Mike-

    Apologies for the misdirection. The original context of the thread was deploying a PHP application as a Web Role, but I see now that you are deploying to Windows Azure Websites (right?). If that is correct, you don't need to create a web.config. You can turn on detailed errors in the Management Portal. Details for how to do so are in this post: Windows Azure Websites: A PHP Perspective (look at the How do I configure a site? and How do I configure PHP? sections).

    If I'm wrong about you using Windows Azure Websites, then I suggest reading this post: Creating a Web Role in Windows Azure. The tools in that post will create a web.config file for you, but you will need to add the <httpErrors errorMode="Detailed" /> element to it.

    While I'm adding resources, I might as well point you to this one too: Windows Azure Websites, Web Roles, and VMs: When to use which?

    -Brian


    This posting is provided "AS IS" with no warranties, and confers no rights. http://blogs.msdn.com/brian_swan

    Wednesday, June 27, 2012 10:27 PM