Pthreads (4) php7 only supports pthreads extension in cli mode

Source: Internet
Author: User
Tags sapi
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.