3

There is an IIS server with the XDEBUG extension installed, running a PHP application. I can't change nothing on this server. Sometimes, the dev team here needs to debug it, without changing code. Just put some breakpoints and execute it step by step.

I can do it from my computer using Eclipse and remote debugging. But I would like to create a Debian server, in a VM, to make it easy for anyone with just a browser to place breakpoints and step debug that server, without needing to set up an environment.

I tried many Web-Based IDEs (codiad, cloud9, etc), but they don't offer XDEBUG integration. Is there any web-based IDE that I can install in my own server that offers PHP debugging? Please read this paragraph again and don't answer with spam

Or, is there anyway I could run something in the server side such as Sublime Editor, Notepad ++, or whatever, and see it running in a browser? Maybe a Java applet.

Any bright ideas will be very much appreciated! Thanks!

2 Answers 2

4

We just released support for debugging PHP with Xdebug inside Cloud9 IDE.

You can place breakpoints (normal or conditional), step over/in/out, set watch expressions, view the call stack, and inspect variables and values. There's also an REPL mode to evaluate code directly.

It's ready to try, but please make sure the correct dependencies are installed on the workspace by running the following commands:

$ npm install -g debug
$ sudo apt-get install php5-xdebug

Set your breakpoints, then click Run > Run With > PHP (cli) to start the debugger and PHP CLI script.

Would love to hear what your feedback is. Our goal is to add support for debugging PHP web pages and Python soon. The implementation is available open-source on GitHub (https://github.com/c9/c9.ide.run.debug.xdebug)

I also made a quick demo video to show you how it works.

Sign up to request clarification or add additional context in comments.

2 Comments

Just for reference, there is an updated guide to doing this here c9.io/blog/debug-your-php-code-with-xdebug-and-cloud9
Back in 2015 when I asked this question, I did not have time to implement XDebug as mentioned by Ruben Daniel, it was just a requirement of the company that could not be fulfilled by the available options back then. Now the company I worked for doesn't even exist anymore. I am marking this post as answer because now (late 2017) I have seen the impressive amount of improvements made to Cloud9, have tested it and I am sure that Cloud9 as it is today would have solved that!
3

I'm founder of Cloud9, so expect extreme bias.

If you are a decent (or better) coder, I have a solution for you. We already have an implementation of XDebug in javascript here: https://github.com/ajaxorg/lib-phpdebug. It might need a bit of updating as it was written for Node 0.6. It does support the latest xdebug.

In addition, we've just released an SDK that allows you to write plugins for Cloud9. Find more info here: http://cloud9-sdk.readme.io/v0.1/docs/getting-started-with-cloud9-plugins. It allows you to install Cloud9 on your own computer or server and you can develop plugins there. You can also distribute your plugin(s) via c9.io and use the SSH workspace feature to have Cloud9 automatically connect to your VM over SSH.

We just released the (pre-alpha) version of the SDK and are actively supporting the handful of developers on the mailinglist here: https://groups.google.com/forum/#!forum/cloud9-sdk.

Implementing a debugger for Cloud9 is actually fairly straightforward. Someone recently built a C++ debugger, which is still in PR here: https://github.com/c9/c9.ide.run.debug/pull/4. You only need to implement one class, the debugger implementation as documented here: https://docs.c9.io/api/#!/api/debugger.implementation. Since there's already an implementation of the xdebug protocol, tying these things together should only be a few days of work.

I hope this helps.

1 Comment

Thanks Ruben, great stuff! Will take a look for sure! I just loved the cloud9 interface (for me, the best web-based IDE I tried, out of many).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.