PHP中的pthreads问题 [英] Problems with pthreads in PHP

查看:224
本文介绍了PHP中的pthreads问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在PHP中遇到pthreads问题.

I have a problem with pthreads in PHP.

当我开始使用Apache时,我看到这样的错误:

When I start apache I see error like this:

php.exe - Entry point not found
The procedure entry point was not found _zend_hash_update@@12 in library D:\xampp\php\ext\php_pthreads.dll

当我在CMD中执行脚本时,会有一个警告:

When I execute script in CMD I have a warning:

PHP Warning:  PHP Startup: Unable to load dynamic library 'php_pthreads.dll' (tried: D:\xampp\php\ext\php_pthreads.dll

我将pthreadVC2.dll复制到:

I copied pthreadVC2.dll to:

C:/windows/system32
D:/xampp/php
D:/xampp/apache/bin

然后我将最后一个文件php_pthreads.dll复制到:

And I copied last file php_pthreads.dll to:

D:/xampp/ext

我在php.ini行中添加了:

I added to php.ini line with:

extension=php_pthreads.dll

我的配置:

  • XAMPP on Windows 10
  • PHP Version 7.3.0
  • Compiler: MSVC15 (Visual C++ 2017)
  • Architecture: x86
  • Thread Safety is enabled
  • Thread API is Windows Threads
  • php_threads 3.1.6 x86 downloaded from https://windows.php.net/downloads/pecl/releases/pthreads/3.1.6/

我在php 7.2.x中尝试过,但我遇到了同样的问题,但出现了其他Apache启动错误消息. 也许有人可以帮助我.

I tried in php 7.2.x and i had the same problem but other apache startup error message. Maybe someone can help me.

推荐答案

我的问题已解决!

我的建议

  • 在xampp上将PHP降级到7.2.x版本(因为pthreads 3.2.0可与php 7.2兼容)
  • 下载并安装php_pthreads-3.2.0(与MSVC 15编译后的版本相同) PHP.链接: https://github.com/krakjoe/pthreads/releases )
  • 从apache/bin中删除pthreadVC2.dll(因为不需要它)
  • 复制php.ini并将副本另存为php-cli.ini
  • 从php.ini中删除具有extension = php_pthreads.dll的行(此行必须存在于php-cli.ini中)
  • Downgrade to 7.2.x version PHP on xampp (because pthreads 3.2.0 is compltible with php 7.2)
  • Download and install php_pthreads-3.2.0 (which is compiled MSVC 15 the same as PHP. Link: https://github.com/krakjoe/pthreads/releases)
  • Delete pthreadVC2.dll from apache/bin (because it isn't needed)
  • Make copy php.ini and save copy as php-cli.ini
  • From php.ini remove line with extension=php_pthreads.dll (this line must be exist in php-cli.ini)

尝试使用CMD命令:php --ini并检查已加载的配置文件".必须将其设置为php-cli.ini.并尝试执行以下命令:php -i并在结果中找到pthreads.

Try in CMD command: php --ini and check Loaded Configuration File. That must be set as php-cli.ini. And also try command: php -i and find pthreads in result.

这篇关于PHP中的pthreads问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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