Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Recomendations for troubleshooting

Posted on 2007-11-26
Last Modified: 2008-02-01
Recently, I have run into scripts that would not run using PHP and Ajax methodology.  Most of the scripts seem to fail silently for whatever reason.  I do not get an error in the firebug, apache or php error logs.  My question is how can I trouble shoot silent failing scripts?  Can anyone recommend any help?  
Question by:taynet29
  • 3
  • 3
LVL 27

Accepted Solution

yodercm earned 250 total points
ID: 20351392
Put echo statements into the script at various places, to see where it fails.

echo "Step 1 got to here<br>";

echo "Step 2 got to here<br>";

and then run them.  As you see which echo statements are executed, you can narrow down the problem.

Another thing to do is take out any @'s on mysql statements.  They block the error message from showing.
LVL 21

Assisted Solution

nizsmo earned 250 total points
ID: 20352610
Also it is good practice to echo out any variables which are returned from elsewhere, just to make sure that it actually returns something.
If you still cannot debug your script, an option may be to write a similar but much simpler version of your script and narrow down on exactly what the problem is.

Author Comment

ID: 20353580
Mostly it revolves around verifying that the server's response to an XMLHTTPRequest is what you think it is. Firebug has a feature to display these response packets, but I often run the queries directly, either in a browser or from the command line. Doing it in a browser tends to work best when the response is something the browser knows how to display. If you need to test a POST request, a command line tool like curl or wget will probably be easier.
Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

LVL 27

Expert Comment

ID: 20354080
Thank you for the points, but could you tell me for future reference, what else should I have said/done to rate a grade of A?

Author Comment

ID: 20354216
Well, I did not give you an "A" simply because it was a rather basic responses.  Not to say, you were completely off topic but I was looking for something a little more geared towards the topic of Ajax and PHP.  Perhaps, it was the question.  Next time I will be more specific.

FYI - The comment that I left, was some information my coworker provided me, which I felt was a little more towards Ajax.
LVL 27

Expert Comment

ID: 20354622
OK, thanks for the reply.  May I suggest in the future, you give a little more indication of your level of expertise or answer you are looking for.  We get a lot of very "basic" questions on here, and when the questioner sounds like someone who doesn't know where to start, "basic" answers are often best.  You did describe yourself as "Beginner on this subject". :)


Author Comment

ID: 20358457
Thanks for your help.

Featured Post

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question