Solved

Recomendations for troubleshooting

Posted on 2007-11-26
7
380 Views
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?  
0
Comment
Question by:taynet29
[X]
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
7 Comments
 
LVL 27

Accepted Solution

by:
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.
0
 
LVL 21

Assisted Solution

by:nizsmo
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.
0
 

Author Comment

by:taynet29
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.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 27

Expert Comment

by:yodercm
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?
0
 

Author Comment

by:taynet29
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.
0
 
LVL 27

Expert Comment

by:yodercm
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". :)

Cheers.
0
 

Author Comment

by:taynet29
ID: 20358457
Thanks for your help.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

735 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