3

I am starting a website, thus I'm learning how to program in html/css/php. For other languages I have learnt so far, there has always been an IDE or interactive console that I can type in codes directly to see how they works, access variable types etc., which makes learning and debugging a breeze. (E.g. bash, python, matlab, perl, tcl...)

Can I do the same for html and php? In the spirit stackoverflow's questions style, lemme try to make the questions a little more specific.

I know I can use php interactively on a terminal. But that is insufficient if I want to see how it works in a html script. Is there a browser/IDE with a console where I can input commands interactively and see the results?

Macad_hack
  • 491
  • 7
  • 11
  • PHP with the browser is not interactive. It's server-side and for a refresh in the browser, a new request has to be fired. You might want to make use of a debugger like Xdebug. Checkout Phpstorm for example, it has a 30 day trial. – hakre Dec 21 '12 at 01:36

4 Answers4

3

For PHP:

  1. I'd suggest to use Xdebug.
  2. Read through this article: Debugging techniques for PHP programmers.
  3. Note about debugging production.

For your markup:

  1. Read Firebug-like debugger for Google Chrome.
  2. Also, you might try Web Developer extension.
Community
  • 1
  • 1
Roman Newaza
  • 11,405
  • 11
  • 58
  • 89
  • 1
    These are really helpful links. Seems like I will have to adopt a slightly different approach to learning php/html than the one I am used to. Thank you! – Macad_hack Dec 21 '12 at 06:38
0

I find enabling errors is handy for general debugging. With it enabled you can see where the script failed and hone in on the error quite easily. For more advanced stuff Xdebug has it's place.

Combined with a local WAMP installation you have a great start point. Save the php script, execute it and combined with "Firebug" (FF extension) and you have a decent "beginners" tool set for debugging.

Graham Mitchell
  • 33
  • 1
  • 1
  • 9
0

you can make your browser your ide. i do, check it out:

handy article showing how to output php to browser console. http://sarfraznawaz.wordpress.com/2012/01/05/outputting-php-to-browser-console/

as for html, download web developer extension for your browser, and validate your markup to test/debug.

albert
  • 8,112
  • 3
  • 47
  • 63
0

You might be interested in something like Cloud9 IDE.

Check them out at: www.cloud9ide.com

PhearOfRayne
  • 4,990
  • 3
  • 31
  • 44