How to debug 500 Internal Server Error

PHP Tools [?] extends Visual Studio with set of advanced features to work more efficiently with PHP code.

How to debug 500 Internal Server Error

Postby gregoryagu » July 17th, 2014, 3:14 pm

I have a PHP app that I am running in Visual Studio 2013 and am using PHP Tools.

The app starts up, runs several PHP pages and then errors out with an Internal Server Error (500).

I have not been able to debug this. Is there a way to see more detailed information about the error?

When I put a breakpoint on the page, the breakpoint is never hit. So I think that somehow, IIS Express is not able to find the page. But the page is in the directory so it doesn't make any sense.

So is there any way to find out what the error was exactly?

Greg
gregoryagu
 
Posts: 9
Joined: October 4th, 2013, 10:31 am

Re: How to debug 500 Internal Server Error

Postby gregoryagu » July 17th, 2014, 8:17 pm

Here is how I found the exact error:

Run Phpinfo.php

Look under the "error_log" for the error log location.

Open error log and find error.

In other words, the built-in PHP server uses the same log as PHP.
gregoryagu
 
Posts: 9
Joined: October 4th, 2013, 10:31 am

Re: How to debug 500 Internal Server Error

Postby Miloslav Beno » July 19th, 2014, 8:53 am

Hi Greg,

Thanks for the question and providing the answer as well. Most of the fatal exceptions/errors break by the debugger by default. But some of them happen even before the debugger is initialized. e.g. parse error on first page.

Thanks,
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm


Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 112 guests

User Control Panel

Login

Who is online

In total there are 112 users online :: 0 registered, 0 hidden and 112 guests (based on users active over the past 5 minutes)
Most users ever online was 487 on April 27th, 2024, 10:08 am

Users browsing this forum: No registered users and 112 guests