Solved

Recomendations for troubleshooting

Posted on 2007-11-26
7
377 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
  • 3
  • 3
7 Comments
 
LVL 27

Accepted Solution

by:
yodercm earned 250 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 27

Expert Comment

by:yodercm
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks for your help.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

728 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now