Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@ostream interesting. exec, popen, new Process, didn't read about shell_exec.
This language is bullshit.
exec with & didn't work for me, why would shell_exec? The response was blocked until the process finished. -
@nitwhiz i don't think there's going to be a way to do it.
You want the parent process of a fork to return and exit, and the child to keep working. I'm not sure if that's possible. The parent process must wait for the child to exit before it can. -
Just saying: this has nothing to do with PHP.
Whenever devs start fiddling around with stuff like process handling, shared memory, semaphore locking etc ...
PHP isn't the right language.
Neither is NodeJS or similar web backend language.
You *can* do it in PHP.
But it will be a painful, limited and errorprone solution.
Like others said: You're looking for sth like a job server / queue system etc.
Related Rants
-
linuxxx32*client calls in* Me: good morning, how can I help you? Client: my ip is blocked, could you unblock it for m...
-
DRSDavidSoft28Found this in our codebase, apparently one of my co-workers had written this
-
Korvax31Italian chef: We have the best spaghetti in the world PHP developer: I doubt that
I challenge you to start a process from php.
The following criteria must be fulfilled:
- php-fpm
- the process is started on http request by user
- the response does not wait for the process to be finished
- the process must finish, possibly after the response reached the user
- the running process does not block a fpm thread/worker from handling further requests
Simple, right?
rant
php
symfony
wtf
ppid
process
exec
proc