NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Debugging local Drupal Web Site


Joined: 27 Dec 2015
Posts: 9
Reply with quote
I'm trying to debug some Drupal PHP code on a local host. I've set up the debugger correctly according to dbg-wizard.php. I started a Drupal session in IE, got to the point where I wanted to start debugging, selected "debug next page", and got the following...

Quote:
Debugger New debug session with //127.0.0.1/drupal/index.php has started. But IDE could not find the project for the web debugging.
Breakpoints and other features may fail to work 12:54:58 PM


I feel like I'm missing some steps, or, misunderstand how the debugging should work. The page I'm trying to debug is not index.php. Can someone point out what I'm doing wrong. I've watched the screen casts, but, I still feel like there's some information lacking.
View user's profileFind all posts by baradaniktoSend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
With Drupal most requests do go through index.php due to a rewrite rule in the .htaccess file.

Try adding a breakpoint to index.php and see if it works. I've seen that message many times where breakpoints and debugging worked absolutely fine.

Does your Drupal site run okay with 127.0.0.1 ? Older Drupal was quite fussy about having a valid domain name (eg mysite.local) to run properly. It could run with localhost (which is not a valid domain name) or an IP address, but it caused problems. I'm not sure if newer versions of Drupal behave better, but other frameworks have similar issues.

If you debug other sites using 127.0.0.1 or localhost then you could find cookies a problem because the cookies will be shared.

You can define your own domain names using your computers hosts file and you might find that is useful in many respects, including debugging.
View user's profileFind all posts by plugnplaySend private message


Joined: 27 Dec 2015
Posts: 9
Reply with quote
Setting a break point in index.php does work with the site running as localhost.

I've had plenty of experience debugging with other IDEs (Visual Studio, Eclipse, etc.). Is the debugging methodology the same with PHPED? For instance, do I just need to know what code I want to set a break point, set it, and work from there?
View user's profileFind all posts by baradaniktoSend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
PhpED debugging works more similarly to other non-PHP IDE's such as VisualStudio than Eclipse (with xdebug or Zend debugger) does. For example, it supports setting of the next statement and better visualisation of variable values in callers.

Whilst the PHP IDE itself gets some negative comments for lacking features, the NuSphere debugger does appear to be technically better than the other PHP debuggers.

You can set breakpoints anywhere, plus can use local or global expressions for activating those breakpoints. You can also use the DebugBreak() statement with is a convenient way of pausing executing due to complex conditions, good for CLI, cron or other code that maybe runs outside of a debug session, or you can use it like an assert.
View user's profileFind all posts by plugnplaySend private message
Debugging local Drupal Web Site
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic