问题
How to do multithreading in PHP7? The first problem I see with pthread
is coming directly from PHP manual.
https://secure.php.net/manual/en/intro.pthreads.php
The pthreads extension cannot be used in a web server environment. Threading in PHP should therefore remain to CLI-based applications only.
Is is safe to oversee this warning, and spawn some threads on HTTP requests?
回答1:
Is is safe to oversee this warning, and spawn some threads on HTTP requests?
The extension itself prohibits loading anywhere but CLI: Attempting to load in any other SAPI will result in a fatal error.
来源:https://stackoverflow.com/questions/42266813/multithreading-in-php-7