Page 1 of 1

php form intermittent problem - times out?

Posted: Mon Nov 03, 2008 10:48 am
by iamannillusion
I have a survey form, it is very large. Most of the time it works just fine, I get submissions all the time. But I also get frequent complaints from people that when they hit submit...'nothing happens'. It just hangs there.

Obviously it's not the php code within the form or it wouldn't work at all. Can someone shed some light on this form me? Is it something in their internet connections? The sql server? I am at my wit's end!

Thanks in advance!!

Re: php form intermittent problem - times out?

Posted: Mon Nov 03, 2008 4:39 pm
by infolock
Could be a number of issues: a) user's connection, b) server response could be hanging, c) could be issue with application being able to connect to MySQL (if it's doing that), etc etc.

Post some code, we'll look at it. If it's not the code, then my bet is it's with the server (or db).

Re: php form intermittent problem - times out?

Posted: Tue Nov 04, 2008 12:18 am
by zephyr750
As already mentioned, it could be any one of a number of things.

If it is feasible, I would suggest taking it off line for a while and trying to reproduce the problem.

Some possible culprits that spring to mind are database access issues/conflicts or genuine server time outs.

i) using setting "ini_set('display_errors', true);" in your script should show any php/database issues that you may have.

things to check in your php.ini (whether any of these is a problem should show up in php error reports after setting 'display_errors' true):-
;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

max_execution_time = X ; Maximum execution time of each script, in seconds
max_input_time = X ; Maximum amount of time each script may spend parsing request data
memory_limit = X ; Maximum amount of memory a script may consume (8MB)

If it is not feasible to take the site offline for testing, look in the PHP.ini again for "error_log = filename". this log file (usually found in the public html or sub-domain root) may shed some light on things for you.

Keep in mind that this problem could be a result of multiple people acessing a resource on your server at the same time (database sharing violations, key sequence mismatches etc), so try to reproduce this scenario in any offline testing that you do.

Re: php form intermittent problem - times out?

Posted: Wed Nov 05, 2008 4:02 pm
by infolock
Just my personal opinion, i would never alter those things except for MAYBE the memory limit. if it is timing out due to max execution time, you have a serious problem with your application. I have written some extremely advanced applications and i've never had to exceed the 30 second default timeout. hell, 8-10 seconds should really be the default imo. 30 seconds just give way too much cushion for writing some really ugly code =\