Pthreads (iv) PHP7 only supports the use of pthreads extensions in CLI mode

Source: Internet
Author: User
1 error!

With PHP7, after compiling to install the extension, run PHP-FPM error, in the company did not solve, home on the Mac to reproduce the problem:

[24-mar-2016 23:06:50] notice:php message:php Fatal error:the fpm-fcgi SAPI is isn't supported by Pthreads in Unknown on line 0
Fatal Error: The fpm-fcgi SAPI is not supported by Pthreads in Unknown on line 0

[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 in Unknown on line 0

2 Why?

Always thought this problem is probably because of php7 instability caused, later saw someone on Baidu said PHP7 only allow CLI mode use pthreads extension, on this doubtful, OK, on GitHub look:

pthreads v3 is restricted to operating in CLI Only:i has spent many years trying to explain this threads in a Web SE RVer just don ' t sense, after 1,111 commits to Pthreads I had realised that, my advice was going unheeded.

So I ' m promoting the advice-hard and fast fact: You can ' t use pthreads safely and sensibly anywhere but CLI.

Thanks for listening;)

The above is the author's exact words

3 SOLVE:

CLI mode, PHP will first read Php-cli.ini, if not found will use PHP.INI,SO:

"1" CP php.ini Php-cli.ini//extension=/... (path): /pthreads.so

"2" edit original php.ini file comment out pthreads extension//; extension=/. (path): /pthreads.so

In this way the CLI mode Php-cli.ini takes effect, and PHP-FPM does not read 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.