Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multithreading in PHP 7

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?

like image 767
Amr ElAdawy Avatar asked Apr 09 '26 22:04

Amr ElAdawy


1 Answers

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.

like image 115
Joe Watkins Avatar answered Apr 12 '26 11:04

Joe Watkins