Pthreads (4) php7 only supports the use of pthreads extension 1 ERROR in cli mode!
Php 7 is used, and extensions are installed after Compilation. When php-fpm is run, an error is reported. The problem is not solved in the company. go home and reproduce the problem on mac:
[24-Mar-2016 23:06:50] NOTICE: PHP message: PHP Fatal error: The fpm-fcgi SAPI is not supported by pthreads in Unknown on line 0
Fatal error: The fpm-fcgi SAPI is not supported by pthreads inUnknownOn line0
[24-Mar-2016 23:06:50] NOTICE: PHP message: PHP Fatal error: Unable to start pthreads module in Unknown on line 0
Fatal error: Unable to start pthreads module inUnknownOn line0
2 WHY?
I always thought this problem may be caused by the instability of php7. later I saw someone on Baidu saying that php7 only allows pthreads extension in CLI mode. I am skeptical about this. okay, go to github and check it out:
Pthreads v3 is restricted to operating in CLI only: I have spent policyears trying to explain that threads in a web server just don't make sense, after 1,111 commits to pthreads I have realized that, my advice is going unheeded.
So I'm promoting the advice to hard and fast fact:You can't use pthreads safely and sensibly anywhere but CLI.
Thanks for listening ;)
The above is the original words of the author.
3 SOLVE:
In CLI mode, php will first read the php-cli.ini, if not found to use php. ini, SO:
[1] cp php. ini php-cli.ini // extension =/... (path) ../pthreads. so
[2] edit the original php. ini file and comment out the pthreads extension //; extension =/... (path).../pthreads. so
So the php-cli.ini works in CLI mode, while php-fpm does not read the php-cli.ini