I'm looking for examples folks might have of running a web server via PHP CLI. I've always used PHP-FPM or and Apache module, but both are explicitly incompatible with the Parallel extension for PHP.
That's cool, but I have a legit reason to spawn a thread and want to combat the stated problems of using multithreading in a webserver application.
So any examples of `php sever.php` spawning a full server app would be super welcome.
@ericmann But, whenever I’ve had a need to spawn a thread in PHP, I’ve always done something like:
exec('php script.php 2>&1 >/dev/null &');
You can’t easily get a response from it, but it works, and I’ve used it on high-traffic sites without performance issues.
The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!