简体   繁体   English

无法加载动态库'C:\\ php \\ ext \\ php_pthreads.dll'

[英]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安装说明更多涉及:

  1. Download a thread safe version of PHP, eg php-5.6.38-Win32-VC11-x86 . 下载PHP的线程安全版本,例如php-5.6.38-Win32-VC11-x86
    • extract the .ZIP file to your hard drive, eg C:\\php . 将.ZIP文件解压缩到您的硬盘驱动器,例如C:\\php
  2. Download the matching version of pthreads, eg php_pthreads-2.0.10-5.6-ts-vc11-x86 . 下载匹配的pthreads版本,例如php_pthreads-2.0.10-5.6-ts-vc11-x86
    • extract pthreadVC2.dll into the PHP folder, eg C:\\php . pthreadVC2.dll到PHP文件夹中,例如C:\\php
    • extract php_pthreads.dll into the extensions folder, eg C:\\php\\ext . php_pthreads.dll到extensions文件夹,例如C:\\php\\ext
  3. In the PHP folder, copy either php.ini-development or php.ini-production to php.ini . 在PHP文件夹中,将php.ini-developmentphp.ini-production复制到php.ini
  4. Edit 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.

相关问题 PHP启动:无法加载动态库“ php_pthreads.dll” - PHP Startup: Unable to load dynamic library 'php_pthreads.dll' PHP启动:无法加载动态库'C:\\\\ xampp \\\\ php \\\\ ext \\\\ php_sqlsrv_7_nts.dll' - PHP Startup: Unable to load dynamic library 'C:\\xampp\\php\\ext\\php_sqlsrv_7_nts.dll' 无法加载动态库 'c:/wamp/bin/php/php5.5.12/ext/php_intl.dll' - Unable to load dynamic library 'c:/wamp/bin/php/php5.5.12/ext/php_intl.dll' 错误:无法加载动态库'C:\\ PHP \\ ext \\ php_sqlsrv.dll - Error: Unable to load dynamic library 'C:\PHP\ext\php_sqlsrv.dll yaml xampp 警告:无法加载动态库 'C:\xampp\php\ext\php_yaml.dll' - yaml xampp warning: Unable to load dynamic library 'C:\xampp\php\ext\php_yaml.dll' 无法加载动态库'C:\\ xampp \\ php \\ ext \\ php_imagick.dll'-找不到指定的模块 - Unable to load dynamic library 'C:\xampp\php\ext\php_imagick.dll' - The specified module could not be found PHP 启动:无法加载动态库 'C:\\xampp\\php\\ext\\php_oci8_12c.dll' - 找不到指定的程序 - PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_oci8_12c.dll' - The specified procedure could not be found 无法加载动态库'C:\\\\ xampp \\\\ php \\\\ ext \\\\ php_oci8_12c.dll。 指定的模块无法找到 - Unable to load dynamic library 'C:\\xampp\\php\\ext\\php_oci8_12c.dll. The specified module could not be found php_pthreads.dll-找不到指定的模块。 - php_pthreads.dll - The specified module could not be found.? 如何修复 PHP 警告:PHP 启动:无法加载动态库 'ext\\\\php_curl.dll'? - How to fix PHP Warning: PHP Startup: Unable to load dynamic library 'ext\\php_curl.dll'?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM