Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 967491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:19:32+00:00 2026-05-16T02:19:32+00:00

I have php scripts that call perl scripts to do various things and sometimes

  • 0

I have php scripts that call perl scripts to do various things and sometimes I get it where it just goes on and on without getting a response back, this is based on the variable that is being passed to the perl script and I am doing a lot of different ones in succession so I can’t get really debug it directly since I don’t have a response from perl…

I would really like to just be able to set a php function or block of code to timeout after a certain number of seconds.. I have been searching on this but haven’t found anything yet on how to do this,

I was thinking something like this could work but I don’t think it would dynamically update the $time variable, but maybe there is a way to get this to work? Any advice is appreciated

$time = time();
$timeout = $time + 5; //just as an example

do {

// do stuff
} while ($time < $timeout)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T02:19:33+00:00Added an answer on May 16, 2026 at 2:19 am

    Your best bet would be to use proc_open, sleep for your timeout amount and then call proc_terminate if the process still hasn’t completed.

    See https://www.php.net/manual/en/book.exec.php for details on the proc_* family.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 489k
  • Answers 489k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If `@IDTable' is empty then what rows do you return?… May 16, 2026 at 8:51 am
  • Editorial Team
    Editorial Team added an answer You can query the msdb backupset table for this kind… May 16, 2026 at 8:51 am
  • Editorial Team
    Editorial Team added an answer That would appear to be a problem noted here and… May 16, 2026 at 8:51 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a PHP script that has a runtime of 34 seconds. But it
I've written some PHP scripts to do some server-side work on a headless linux
I have a script that colors the requested country on a world map with
I have a daily cron job that grabs 10 users at a time and
Not really looking for code examples here, just concepts. I have three sections on
I make an AJAX request like so using JQuery: $.ajax({ type: GET, url: getvideo.php,
I have a PHP application containing these files: landing.php, redirect.php, ajax.php on a page
I have a little personal webapp that I'm working on. I have a link
Since cruise control is full of bugs that have wasted my entire week, I
How does Flash communicate with services / scripts on servers via AMF ? Regarding

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.