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 6118865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:29:09+00:00 2026-05-23T15:29:09+00:00

I want to launch ~10 php processes from a bash script. When one of

  • 0

I want to launch ~10 php processes from a bash script. When one of them finishes, I’d like the bash script to launch another php process, and continue on indefinitely, always having ~10 php processes running.

What is the simplest way to do this?

The php file launched will be the same every time, but the php process will know to pull new values from the database so it’s processing new data each time. The file I need to launch and all it’s classes are already written in php.

  • 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-23T15:29:10+00:00Added an answer on May 23, 2026 at 3:29 pm

    Seems like a good fit for superivisord. The following configuration will make sure that 10 processes are always running, and deals with log rotation, which is also handy. All output, including stderr, will be written to /var/log/worker.log. With “autorestart=true”, supervisord will replace a child process as soon as it exits.

    [program:worker]
    command=php /path/to/worker.php
    process_name=%(program_name)s_%(process_num)d
    stdout_logfile=/var/log/%(program_name)s.log
    redirect_stderr=true
    stdout_capture_maxbytes=512MB
    stdout_logfile_backups=3
    numprocs=10
    numprocs_start=0
    autostart=true
    autorestart=true
    

    Once you have the supervisor config in place (usually /etc/supervisord/conf.d), you can use supervisorctl as a convenient way to start and stop the process group.

    $ supervisorctl start worker
    ...
    $ supervisorctl stop worker
    ...
    $ supervisorctl status
    worker:worker_0              RUNNING    pid 8985, uptime 0:09:24
    worker:worker_1              RUNNING    pid 10157, uptime 0:08:52
    ...
    worker:worker_9              RUNNING    pid 12459, uptime 0:08:31
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to be able to launch a Java server process from an existing
I have a ClickOnce deployed application I want to launch from VBScript, similar to
I want to launch a python script similar to this web crawler , wait
I have a PHP script launched from a command-line (aka CLI mode, no webserver
One page on my web site is a PHP script that uses exec() to
i want to launch an intent from android website what code do i need
I want a hyperlink on my main page to launch an HTML help page
I'm from PHP background. I used to use Apache, MySQL and PHP for web
This is a little tricky so bear with me: I have a PHP script
I use this inside a function, document.getElementById(DeleteConfirmationdiv).style.display = 'block'; now I want to launch

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.