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
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
  • 3
  • 3
LVL 27

Accepted Solution

Cornelia Yoder 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.
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

LVL 27

Expert Comment

by:Cornelia Yoder
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

by:Cornelia Yoder
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

710 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