[英]Unable to load dynamic library 'C:\php\ext\php_pthreads.dll'
I'm trying to have threads in my php code, but I can't get my head around pthreads library and every time I run my program I encounter this error: 我正在尝试在我的PHP代码中使用线程,但我无法理解pthreads库,每次运行程序时都会遇到此错误:
Warning: PHP Startup: Unable to load dynamic library 'C:\php\ext\php_pthreads.dll' - The specified module could not be found.in Unknown on line 0
I followed every step needed: 我遵循了所需的每一步:
I've added the file pthreadVC2.dll in my "C:\php" folder
I've added the file php_pthreads.dll in my "C:\php\ext"folder
I've modified the file php.ini, enabling the extension: extension=php_pthreads.dll
I've also added pthreadVC2.dll to system32 folder.
Here is my phpinfo() : 这是我的phpinfo() :
PHP Version => 5.6.38
Compiler => MSVC11 (Visual C++ 2012)
Architecture => x64
And here is the version of pthreads I used: 这是我使用的pthreads的版本:
php_pthreads-2.0.9-5.6-ts-vc11-x64
I have read similar topics on the issue, even did try everything step by step according to a video tutorial but nothing works. 我已经在这个问题上阅读了类似的主题,甚至根据视频教程逐步尝试了所有内容,但没有任何效果。 What am I doing wrong?
我究竟做错了什么?
Installation is quite straightforward, although a little more involved than the Simple Windows Installation instructions suggest: 安装非常简单,虽然比简单Windows安装说明更多涉及:
C:\\php
. C:\\php
。 pthreadVC2.dll
into the PHP folder, eg C:\\php
. pthreadVC2.dll
到PHP文件夹中,例如C:\\php
。 php_pthreads.dll
into the extensions folder, eg C:\\php\\ext
. php_pthreads.dll
到extensions文件夹,例如C:\\php\\ext
。 php.ini-development
or php.ini-production
to php.ini
. php.ini-development
或php.ini-production
复制到php.ini
。 php.ini
and add the line extension=php_pthreads.dll
at the end of the file. php.ini
并在文件末尾添加行extension=php_pthreads.dll
。 At this point pthreads should be working. 此时pthreads应该正常工作。 You can verify this by opening a command prompt in the PHP folder and executing
php --ri pthreads
: 您可以通过在PHP文件夹中打开命令提示符并执行
php --ri pthreads
来验证这一点:
Note that the PHP and pthreads versions I referenced above require you to install the Visual Studio 2012 (VC11) runtime to function. 请注意,上面引用的PHP和pthreads版本要求您安装Visual Studio 2012(VC11)运行时才能运行。
Edit: For completeness, I downloaded what seem to be the exact versions of PHP and pthreads you are using (the primary difference being x64): 编辑:为了完整性,我下载了你正在使用的PHP和pthreads的确切版本(主要区别是x64):
Following the steps above I received the same result (except the pthreads version is reported as 2.0.9 of course). 按照上面的步骤,我收到了相同的结果(当然,pthreads版本报告为2.0.9)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.