How to remotly debug python on my apache?

How do developers who use VIM or Textmate debug their Python/Ruby/PHP code, both in command line mode and when running through a local Web Server such as Apache?

  • I am in the proces of migrating from IDEs to lighter editors. I have already found a comfortable way to debug my C++ code through CGDB, I was wondering how to go about it with my script languages both in command line (I found pdb for Python, but I was wondering of there are other options) and when running them on my local web server.

  • Answer:

    When i'm developing a ruby or rails app i always put the ruby-debug gem in my Gemfile so that i can put breakpoints in my code and trace the executing using rdebug Here are some resources for Ruby and Rails: http://guides.rubyonrails.org/debugging_rails_applications.html http://cheat.errtheblog.com/s/rdebug/

Adam Schepis at Quora Visit the source

Was this solution helpful to you?

Other answers

I debug python using ipdb. For example, to debug a Django view, I might insert import ipdb; ipdb.set_trace() into the code where I want a breakpoint, then run the local development server and proceed to debug it intractively in the terminal. I don't really use ruby, but I expect the procedure is fairly similar. For PHP you could use something like XDebug, but I've never actually seen it work (either it crashes apache or it just doesn't run). So I just make sure I log everything and then tail the logs. Or during development just var_dump things as I go. That and write tests, right?

Ben Sinclair

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.