/    Sign up×
Community /Pin to ProfileBookmark

How to debug/log 500 error in Ajax response

I’m trying to debug a sporadic 500 error which users occasionally get when filling out form sections on my site. Whenever it happens, I try to recreate their environment and fill out the form exactly as they have done, but can never recreate the issue. I have checked my application logs for the framework I am using, but they report nothing related to the error. I’m hoping someone here might be able to help me catch this. This is where the 500 error is sometimes happening and this triggers the error which users report:

[CODE]//In jquery AJAX function, which submits data to PHP form for processing
error: function(data,transport){
$.validationEngine.debug(“error in ajax response: “+data.status+” “+transport)
} [/CODE]

Is there a way for me to try and catch what the exact error is here? The problem is I can’t recreate the error, either using an AJAX call or not to call the PHP script. I need to catch the error response from the PHP script being called, but I never get an error when trying to recreate the user issue, i.e same OS/browser/form answers. The Apache error logs for the site have very little – unless I’m looking in the wrong place. I’m on CentOS, ran locate error_log and got an error_log.txt file in my vhosts directory for my site, but this just contained a 302 message log, nothing else. I also tried locate error | grep mysite.

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @franko75 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...