php form intermittent problem - times out?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
iamannillusion
Forum Newbie
Posts: 1
Joined: Mon Nov 03, 2008 10:44 am

php form intermittent problem - times out?

Post 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!!
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Re: php form intermittent problem - times out?

Post 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).
zephyr750
Forum Newbie
Posts: 6
Joined: Sat Nov 01, 2008 8:05 am

Re: php form intermittent problem - times out?

Post 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.
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Re: php form intermittent problem - times out?

Post 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 =\
Post Reply