找不到 PHP 类“线程" [英] Php Class 'Thread' not found

查看:70
本文介绍了找不到 PHP 类“线程"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经通过以下 http://php.net/manual/安装了 pthreadsen/pthreads.installation.phphttp://windows.php.net/downloads/pecl/releases/pthreads/

我的php信息:-phpinfo();

My php info :- phpinfo();

PHP 版本 5.6.30编译器:MSVC11(Visual C++ 2012)架构:x86线程安全:启用

PHP Version 5.6.30 Compiler : MSVC11 (Visual C++ 2012) Architecture : x86 Thread Safety : enabled

但错误仍然存​​在..

But error still exists..

php -m 输出#

php -m PHP 警告:PHP 启动:pthreads:无法编译模块模块 API=20121212 PHP 编译模块 API=20131226 这些选项需要在第 0 行的未知中匹配警告:PHP 启动:pthreads:无法使用模块 API=20121212 PHP 编译的模块用模块 API=20131226 编译这些选项需要匹配Unknown on line 0 [PHP Modules] bcmath bz2 calendar Core ctype curl日期 dom ereg exif 文件信息过滤器 ftp gd gettext hash iconv jsonlibxml mbstring mcrypt mhash mysql mysqli mysqlnd odbc

php -m PHP Warning: PHP Startup: pthreads: Unable t Module compiled with module API=20121212 PHP compiled with module API=20131226 These options need to match in Unknown on line 0 Warning: PHP Startup: pthreads: Unable to ini Module compiled with module API=20121212 PHP compiled with module API=20131226 These options need to match in Unknown on line 0 [PHP Modules] bcmath bz2 calendar Core ctype curl date dom ereg exif fileinfo filter ftp gd gettext hash iconv json libxml mbstring mcrypt mhash mysql mysqli mysqlnd odbc

推荐答案

虽然 Hassan Ahmed 的回复解释了为什么不应该在 Web 服务器环境中使用 pthreads,这不是您收到错误的原因.

Whilst Hassan Ahmed's reply explains why pthreads shouldn't be used in a web server environment, that is not the cause of the error you're receiving.

问题是您下载的 pthreads 二进制文件不是为您使用的 PHP 版本构建的.这会导致 pthreads 的二进制 API 和它集成到的 PHP 的模块 API 之间不匹配.根据您的 PHP 版本判断,您应该使用 pthreads 的 2.0.10 版本,因为这是 PHP 5.6 版本的最后一个稳定版本.

The problem is that the pthreads binary you have downloaded was not built for the PHP version you are using. This causes a mismatch between the pthreads' binary API and PHP's module API that it integrates into. Judging by your PHP version, you should be using the 2.0.10 release of pthreads, since that was the last stable release for PHP 5.6 version.

请注意,不再维护 PHP 5.x 版本对 pthread 的支持.如果您想要最新的错误修复和功能,请使用 PHP 7.x 和 pthreads v3.

Note that support for pthreads for PHP 5.x versions is no longer maintained. If you would like the latest bug fixes and features, then use PHP 7.x and pthreads v3.

这篇关于找不到 PHP 类“线程"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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