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

  • Home
  • SEARCH
  • 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 820591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:30:04+00:00 2026-05-15T02:30:04+00:00

Currently I have a perl script that runs forever on my server, checking a

  • 0

Currently I have a perl script that runs forever on my server, checking a SQS for data to compute. This script has been running for about 6 months with no problems what so ever.

So, now I want to switch over to PHP’S CLI, and have the script loop there forever. Mostly because I’m more familiar with PHP.

Basicly,

$i="forever";
while($i==="forever"){
    doSomething();
    sleep(10);
}

The script will do a shell_exec(“/shell_script.sh”); that can take up to 2 hours to process. Will this trigger a max execution time or similar?

Is this “ok” to do? If not, what is the alternatives?

  • 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-15T02:30:05+00:00Added an answer on May 15, 2026 at 2:30 am

    You will need to make sure that you set the maximum execution time of the script to zero, so that no time limit is imposed. You can do this from the PHP file with,

    set_time_limit(0);
    

    Or you can set it in your php.ini file. (See PHP manual on set_time_limit for more information). Other than that, your approach should work fine.

    However, there’s no need to set a variable and check it in order to loop forever,

    $i="forever";
    while($i==="forever")
    

    You can simply just do while(true) or while(1).

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

Sidebar

Related Questions

I currently have a Perl script that runs an external command on the system,
I currently have a Perl CGI script that parses incoming XML requests using XML::Simple
I have written a Perl script that runs as a daily crontab job that
I have a perl script that generates an index of some data stored in
I currently have a perl script that imports HTML and converts it to plain
I have a perl script that runs a series of batch scripts for regression
I currently have this in my Ant build script: <exec dir=${basedir} executable=perl> <arg line=${basedir}/version.pl
I have inherited a perl script that pulls data out of some files. The
I have a Perl script that reads data from an Excel ( xls )
I am currently learning Perl. I have Perl hash that contains references to hashes

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.