Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 08-05-2005, 10:52 AM   #1
Senior Member
Registered: Mar 2003
Location: Pittsburgh, PA
Distribution: Gentoo / NetBSD
Posts: 1,251

Rep: Reputation: 45
PHP: Browser timeout workaround??

I have a webpage which, when given some info, goes off and executes a perl script in the background. Only problem: the perl script can take up to 120 seconds to execute.

Typically the browser will timeout after about 30 seconds.

I have tried the following to correct this and allow the perl script to finish its run:
1. Use set_time_limit to give the PHP script more time to execute (browser still timed out; sometimes with 'Connection: close' being returned)

2. Used proc_open to create a resource and tried to pass the resource via session variables - this also used a meta-refresh. In case you don't know - I just found out - resources cannot be serialized; aka, cannot be stored in as a session variable.

How do I (either via a single page request or through refreshes) allow the perl script to execute and then return its output to the user?

Thanks for any thoughts and / or ideas.

Old 08-05-2005, 11:08 AM   #2
Senior Member
Registered: Mar 2004
Distribution: Slackware
Posts: 4,617

Rep: Reputation: 137Reputation: 137
If you have access to httpd.conf, you could try set :
KeepAliveTimeout 150
Old 08-05-2005, 11:30 AM   #3
Senior Member
Registered: Mar 2003
Location: Pittsburgh, PA
Distribution: Gentoo / NetBSD
Posts: 1,251

Original Poster
Rep: Reputation: 45
Unfortunately I do not have access tot he 'root' httpd.conf. Is that a directive which I could setup under a localized 'virtual host' conf file? Or is it something which can be placed into an http header from php?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Timeout after 30s (apache+php+postgreSQL) J_Szucs Linux - Software 6 06-08-2015 12:06 AM
Fedora 3 - PHP - Socket timeout b_whelan Linux - Software 2 09-29-2005 03:41 AM
PHP script timeout J_Szucs Linux - Software 4 01-22-2004 05:10 PM
browser does not convert query_string/url spaces to '+', seeking workaround? Sm0k3 Programming 0 11-25-2003 06:44 PM
php registerglobal = off workaround? stelar Linux - Security 2 06-30-2003 03:04 AM

All times are GMT -5. The time now is 05:17 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration