Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Application Debugging

Guest
Aug 28, 2010 Aug 28, 2010

Hello,

I try to develop a site using Dreamweaver CS5, PHP, MySql and Javascript.  The most difficult part is the debugging of PHP code and Javascript. Can sombebody point me towards a tutorial or explain how I can debug PHP code and Javascript.

Thank you,

Carly

TOPICS
Server side applications
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 28, 2010 Aug 28, 2010
LATEST

Carly,

One of the best places to look for errors is in the server logs, if you have access to them. That depends on your host.

For PHP you can insert the following code at the beginning of your file:

<?php

error_reporting(E_ALL);

ini_set('display_errors','on');

?>

Everything that goes to the server log will also show up on your web page. Be sure to remove this ASAP as it could be annoying to general readers and it could give away key information.

Another good trick is to use echo/alert statements in key parts of your code to give you an idea of what is going on. (You could also create a log file on your server, but that's getting pretty elaborate). Again, remove ASAP.

A word of caution with the use of echo in PHP. Some PHP processing is messed up when there's anything sent to the browser before it finished. Doing things with headers, for instance. That goes south with any output.

Hope this helps to get you started.

Barry

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines