PHP7启动:pthreads:无法在Windows 7中初始化模块pthread [英] PHP7 Startup: pthreads: Unable to initialize module pthreads in Windows 7

查看:348
本文介绍了PHP7启动:pthreads:无法在Windows 7中初始化模块pthread的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 7 Enterprise上成功安装了以下软件:

I installed with success on Window 7 Enterprise the following:

httpd-2.4.25-win64-VC14
php-7.1.1-Win32-VC14-x64 (Thread Safe (2017-Jan-18 21:06:35))
php_pthreads-3.1.6-7.0-ts-vc14-x64 from http://windows.php.net/downloads/pecl/releases/pthreads/3.1.6/

phpinfo页面看起来不错,并且启用了线程安全性.

The phpinfo page looks well and Thread Safety = enabled.

我遵循了php_pthreads-3.1.6-7.0-ts-vc14-x64软件包的README.md文件上的所有说明.

I followed all instructons on README.md file of php_pthreads-3.1.6-7.0-ts-vc14-x64 package.

但是,当我执行"php -m"时,出现此错误:

However when I'm executing "php -m" I got this error:

PHP Warning:  PHP Startup: pthreads: Unable to initialize module
Module compiled with module API=20151012
PHP    compiled with module API=20160303
These options need to match
 in Unknown on line 0

Warning: PHP Startup: pthreads: Unable to initialize module
Module compiled with module API=20151012
PHP    compiled with module API=20160303
These options need to match
 in Unknown on line 0
[PHP Modules]
bcmath
calendar
Core
ctype
date

... 我以前在PHP 5.4.33中使用过线程,但是我决定升级到PHP7以支持tlsv1.1和tlsv1.2

... I have used threads before with PHP 5.4.33 but I decided to upgrade to PHP7 to have support for tlsv1.1 and tlsv1.2

推荐答案

错误的原因是pthread dll与已安装的php版本不兼容.

The reason for the error is that pthread dll is not compatible with the installed php version.

根据 github问题讨论最新发行版

According to github issue discussion the last release php_pthreads-3.1.6-7.0-ts-vc14-x64 will not support php 7.0 or 7.1 on windows because of ZTS is broken on thease versions.

因此,如果您在Windows上,并且想使用pthread ..,则必须降级到PHP 5.6或等到PHP 7.2和下一个php_pthreads版本.

So if you are on windows, and want to work with pthread.. you have to degrade to PHP 5.6 or wait to PHP 7.2 and next release of php_pthreads.

另一个选择是使用此beta版本的php_pthreads: https://github.com/SirSnyder/pthreads/releases/标签/v3.1.7-beta.1

Another option is to use this beta version of php_pthreads: https://github.com/SirSnyder/pthreads/releases/tag/v3.1.7-beta.1

这篇关于PHP7启动:pthreads:无法在Windows 7中初始化模块pthread的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆