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.
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.
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:
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?
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.