Multithreading in PHP 7

拥有回忆 提交于 2020-01-04 02:33:08

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!