jjzjj

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

coder 2024-04-16 原文

我试图在我的 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'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.

这是我的phpinfo():

PHP Version => 5.6.38
Compiler => MSVC11 (Visual C++ 2012)
Architecture => x64

这是我使用的 pthreads 版本:

php_pthreads-2.0.9-5.6-ts-vc11-x64

我已经阅读过关于这个问题的类似主题,甚至根据视频教程一步一步地尝试了一切,但没有任何效果。我做错了什么?

最佳答案

安装非常简单,尽管比 Simple Windows Installation 复杂一点。说明建议:

  1. 下载 PHP 的线程安全版本,例如php-5.6.38-Win32-VC11-x86 .
    • 将 .ZIP 文件解压缩到您的硬盘,例如C:\php.
  2. 下载 pthreads 的匹配版本,例如 php_pthreads-2.0.10-5.6-ts-vc11-x86 .
    • pthreadVC2.dll 解压到 PHP 文件夹中,例如C:\php.
    • php_pthreads.dll 解压到扩展文件夹中,例如C:\php\ext.
  3. 在 PHP 文件夹中,将 php.ini-developmentphp.ini-production 复制到 php.ini
  4. 编辑 php.ini 并在文件末尾添加行 extension=php_pthreads.dll

此时 pthreads 应该可以工作了。您可以通过在 PHP 文件夹中打开命令提示符并执行 php --ri pthreads 来验证这一点:

请注意,我在上面引用的 PHP 和 pthreads 版本要求您安装 Visual Studio 2012 (VC11) runtime发挥作用。


编辑:为了完整性,我下载了您正在使用的 PHP 和 pthreads 的确切版本(主要区别是 x64):

按照上述步骤,我收到了相同的结果(当然除了 pthreads 版本报告为 2.0.9)。

关于php - 无法加载动态库 'C:\php\ext\php_pthreads.dll',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52536027/

有关php - 无法加载动态库 'C:\php\ext\php_pthreads.dll'的更多相关文章

  1. ruby-on-rails - rails : "missing partial" when calling 'render' in RSpec test - 2

    我正在尝试测试是否存在表单。我是Rails新手。我的new.html.erb_spec.rb文件的内容是:require'spec_helper'describe"messages/new.html.erb"doit"shouldrendertheform"dorender'/messages/new.html.erb'reponse.shouldhave_form_putting_to(@message)with_submit_buttonendendView本身,new.html.erb,有代码:当我运行rspec时,它失败了:1)messages/new.html.erbshou

  2. ruby-on-rails - 由于 "wkhtmltopdf",PDFKIT 显然无法正常工作 - 2

    我在从html页面生成PDF时遇到问题。我正在使用PDFkit。在安装它的过程中,我注意到我需要wkhtmltopdf。所以我也安装了它。我做了PDFkit的文档所说的一切......现在我在尝试加载PDF时遇到了这个错误。这里是错误:commandfailed:"/usr/local/bin/wkhtmltopdf""--margin-right""0.75in""--page-size""Letter""--margin-top""0.75in""--margin-bottom""0.75in""--encoding""UTF-8""--margin-left""0.75in""-

  3. ruby-on-rails - 'compass watch' 是如何工作的/它是如何与 rails 一起使用的 - 2

    我在我的项目目录中完成了compasscreate.和compassinitrails。几个问题:我已将我的.sass文件放在public/stylesheets中。这是放置它们的正确位置吗?当我运行compasswatch时,它不会自动编译这些.sass文件。我必须手动指定文件:compasswatchpublic/stylesheets/myfile.sass等。如何让它自动运行?文件ie.css、print.css和screen.css已放在stylesheets/compiled。如何在编译后不让它们重新出现的情况下删除它们?我自己编译的.sass文件编译成compiled/t

  4. ruby-on-rails - 无法使用 Rails 3.2 创建插件? - 2

    我对最新版本的Rails有疑问。我创建了一个新应用程序(railsnewMyProject),但我没有脚本/生成,只有脚本/rails,当我输入ruby./script/railsgeneratepluginmy_plugin"Couldnotfindgeneratorplugin.".你知道如何生成插件模板吗?没有这个命令可以创建插件吗?PS:我正在使用Rails3.2.1和ruby​​1.8.7[universal-darwin11.0] 最佳答案 随着Rails3.2.0的发布,插件生成器已经被移除。查看变更日志here.现在

  5. ruby-on-rails - Rails 3.2.1 中 ActionMailer 中的未定义方法 'default_content_type=' - 2

    我在我的项目中添加了一个系统来重置用户密码并通过电子邮件将密码发送给他,以防他忘记密码。昨天它运行良好(当我实现它时)。当我今天尝试启动服务器时,出现以下错误。=>BootingWEBrick=>Rails3.2.1applicationstartingindevelopmentonhttp://0.0.0.0:3000=>Callwith-dtodetach=>Ctrl-CtoshutdownserverExiting/Users/vinayshenoy/.rvm/gems/ruby-1.9.3-p0/gems/actionmailer-3.2.1/lib/action_mailer

  6. ruby - 无法运行 Rails 2.x 应用程序 - 2

    我尝试运行2.x应用程序。我使用rvm并为此应用程序设置其他版本的ruby​​:$rvmuseree-1.8.7-head我尝试运行服务器,然后出现很多错误:$script/serverNOTE:Gem.source_indexisdeprecated,useSpecification.Itwillberemovedonorafter2011-11-01.Gem.source_indexcalledfrom/Users/serg/rails_projects_terminal/work_proj/spohelp/config/../vendor/rails/railties/lib/r

  7. ruby - 在 jRuby 中使用 'fork' 生成进程的替代方案? - 2

    在MRIRuby中我可以这样做:deftransferinternal_server=self.init_serverpid=forkdointernal_server.runend#Maketheserverprocessrunindependently.Process.detach(pid)internal_client=self.init_client#Dootherstuffwithconnectingtointernal_server...internal_client.post('somedata')ensure#KillserverProcess.kill('KILL',

  8. ruby - 如何在续集中重新加载表模式? - 2

    鉴于我有以下迁移:Sequel.migrationdoupdoalter_table:usersdoadd_column:is_admin,:default=>falseend#SequelrunsaDESCRIBEtablestatement,whenthemodelisloaded.#Atthispoint,itdoesnotknowthatusershaveais_adminflag.#Soitfails.@user=User.find(:email=>"admin@fancy-startup.example")@user.is_admin=true@user.save!ende

  9. ruby-on-rails - 无法在centos上安装therubyracer(V8和GCC出错) - 2

    我正在尝试在我的centos服务器上安装therubyracer,但遇到了麻烦。$geminstalltherubyracerBuildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingtherubyracer:ERROR:Failedtobuildgemnativeextension./usr/local/rvm/rubies/ruby-1.9.3-p125/bin/rubyextconf.rbcheckingformain()in-lpthread...yescheckingforv8.h...no***e

  10. ruby - 主要 :Object when running build from sublime 的未定义方法 `require_relative' - 2

    我已经从我的命令行中获得了一切,所以我可以运行rubymyfile并且它可以正常工作。但是当我尝试从sublime中运行它时,我得到了undefinedmethod`require_relative'formain:Object有人知道我的sublime设置中缺少什么吗?我正在使用OSX并安装了rvm。 最佳答案 或者,您可以只使用“require”,它应该可以正常工作。我认为“require_relative”仅适用于ruby​​1.9+ 关于ruby-主要:Objectwhenrun

随机推荐