How many terminal instances are called for each exec() function call in PHP?

Asked

Viewed 44 times

6

If I call a file, it contains the function exec(), on two different terminals, the second will start running only when the first one finishes, or they work independently?

  • Give a little more context to the question. You’re having some kind of problem executing commands with the function exec()?

  • @Rodrigorigotti I’m developing a web service project in which I have a file. php that accesses the database and also calls a file. cpp that calculates the best routes (on a map) from graph manipulation. As there will be several accesses to the server, it would not be possible to use only the function exec() if there is no parallelism in your calls. That is, if two users made the same request, both would receive the response in parallel, or neatly (user 2 receives response after user request 1 is met)?

1 answer

4


For each PHP "exec" call you create a new shell instance in a Linux environment, with your own environment variables.

In Windows I believe the behavior is similar.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.