Internal Server 500 timeout error with broken pipe

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
rodentratman
-


Joined: 22 Jul 2007
Posts: 6

PostPosted: Sun Jul 22, 2007 8:14 am    Post subject: Internal Server 500 timeout error with broken pipe Reply with quote

cgi.log shows the following as the cause of the error

CGI: [C:\PHP\php-cgi.exe ]
URI: /dir/file.php
Broken pipe

Background:

The script performs row reduction on a matrix
(i.e. mathematical operations on an array in PHP ($array[$row][$column])

Everything works fine for a limited number of records (20 seconds worth)but as soon as it gets over about 30 seconds of script execute I receive "Error 500: Internal Server Error".

The timeout in Abyss Configuration is set to 120 seconds.

I've used set_time_limit() in PHP to try to extend the time the script can run with values of 60 and 120 but the error still displays after about 30 seconds.

I've also tried restarting the web server and echoing output as another help resource suggested this may help but with no success.

I'm using XP Home Edition on a Pentium 3 1GHz test PC (and yes I will be upgrading soon but in the meantime hopefully there is a solution to my problem under the given conditions).

Any help is appreciated!

Regards,
Roden
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sun Jul 22, 2007 2:02 pm    Post subject: Re: Internal Server 500 timeout error with broken pipe Reply with quote

rodentratman wrote:
I've used set_time_limit() in PHP to try to extend the time the script can run with values of 60 and 120 but the error still displays after about 30 seconds.


PHP has also its own timeout parameter that has to be increased too: edit php.ini, and change the value of the max_execution_time.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
rodentratman
-


Joined: 22 Jul 2007
Posts: 6

PostPosted: Sun Jul 22, 2007 3:03 pm    Post subject: Re: Internal Server 500 timeout error with broken pipe Reply with quote

--- double posted oops ---

Last edited by rodentratman on Mon Jul 23, 2007 12:42 am; edited 1 time in total
Back to top View user's profile Send private message
rodentratman
-


Joined: 22 Jul 2007
Posts: 6

PostPosted: Mon Jul 23, 2007 12:42 am    Post subject: Re: Internal Server 500 timeout error with broken pipe Reply with quote

aprelium wrote:
rodentratman wrote:
I've used set_time_limit() in PHP to try to extend the time the script can run with values of 60 and 120 but the error still displays after about 30 seconds.


PHP has also its own timeout parameter that has to be increased too: edit php.ini, and change the value of the max_execution_time.


Sorry should've made that clearer. I'd already edited php.ini to the value of 60. I then used set timeout with a matching value of 60 to reset the timer within the script and give it more time and upped it to 120 to see if it made any difference. I also tried changing the php directive to 120 seconds with the same internal server 500 timeout error occurring after roughly 30 seconds.

I'd restarted the Abyss web server but not the actual computer so did that last night. Also noticed that startup errors weren't on which was suggested in a similar post so going to give that a go as well to see if I can get any more information.

I've cleared temporary files and updated my version of Abyss and PHP to the latest versions which mostly seems to have removed the Internal Server 500 Error about 90% of the time which helped me find a bug that was reading column values that didn't exist in rows (was using a count of the number of rows instead of a count of the number of columns).

Even still, the script seems to just stop at around 30 seconds despite having a php.ini directive of 120 seconds, abyss timeout set at 120 and using set_time_out() with varying values.
I'm not getting the pipe error when it just stops without giving me the Internal Server 500 Error (as would be expected) but I'd like to stop the 30 second timeout altogether if I can.

If there's anything else I haven't mentioned that might help, let me know. Sometimes it helps just to have someone else's input even if it's not the solution.

Regards,
Roden
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Mon Jul 23, 2007 2:16 pm    Post subject: Re: Internal Server 500 timeout error with broken pipe Reply with quote

rodentratman,

Are you using PHP with the FastCGI interface? Are you sure you're editing the right php.ini file (create a file with phpinfo() and check the output you get)?
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
rrinc
-


Joined: 24 Feb 2006
Posts: 725
Location: Arkansas, USA

PostPosted: Mon Jul 23, 2007 3:48 pm    Post subject: Reply with quote

Make sure you're using php-cgi.exe if you're using FastCGI.
_________________
-Blake | New Server :D
SaveTheInternet
Soy hispanohablante. Puedes contactarme por mensajes privados.
Back to top View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
rodentratman
-


Joined: 22 Jul 2007
Posts: 6

PostPosted: Tue Jul 24, 2007 3:04 am    Post subject: Reply with quote

rrinc wrote:
Make sure you're using php-cgi.exe if you're using FastCGI.


phpinfo() does show fastcgi, but in any case I think the problem may now be resolved. The new release of PHP and Abyss seemed to reduce the occurrence of the error dramatically despite still timing out.

The new installation of PHP created a new php.ini file in the php installation directory and was using this despite having a directory path pointing to the windows directory where the original was stored so there may have been a conflict which is why I was still receiving 30 second timeouts.

I've started work on a second project so can't test it to be sure but this has definitely given me some insight. Thankyou for your help.

Regards,
Roden
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Wed Jul 25, 2007 2:14 pm    Post subject: Reply with quote

rodentratman,

If you are using our preconfigured PHP 5 package, the php.ini inside the PHP 5 installation directory is the configuration file that is taken into account.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
lestat
-


Joined: 15 Sep 2003
Posts: 130
Location: GREEN BAY

PostPosted: Wed Aug 29, 2007 6:17 pm    Post subject: Reply with quote

Another thing to possibly consider is the script or job you are running. It's pretty unusual for a script or database query to consume this much time. Are you sure it's working correctly? Often times I've accidentally created multiple unnecessary loops in my scripts.

I have however, encountered time issues it during file uploading.

Cheers.
_________________
XP Pro sp2
Abyss Web Server X2 (v 2.9.3.5)
PHP 5.3.8
Back to top View user's profile Send private message AIM Address MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group