简体   繁体   English

关于Win 7和Win10的pTreads

[英]pThreads on Win 7 and Win10

I can't install/add pthreads to my Win7 and Win10 xampp. 我无法在我的Win7和Win10 xampp上安装/添加pthread。 I downloaded the release: 我下载了这个版本:

http://windows.php.net/downloads/pecl/releases/pthreads/ http://windows.php.net/downloads/pecl/releases/pthreads/

unpacked the extension dll (php_pthreads.dll) to extension directory and the runtime dll (pthreadVC2.dll) to php directory (same dir as php.exe) and add extension=php_pthreads.dll to my configuration, but still it doesn't work. 将扩展名dll(php_pthreads.dll)解压缩到扩展目录,将运行时dll(pthreadVC2.dll)解压缩到php目录(与php.exe相同的目录)并将extension = php_pthreads.dll添加到我的配置中,但仍然无法正常工作。

What to do? 该怎么办?

Thanks for the answer. 感谢您的回答。

Nebojša 内博伊沙·

Windows supporting threads at all would be news to me. Windows支持线程对我来说都是新闻。 The P in pthreads stands for POSIX, like Unix. pthreads中的P代表POSIX,就像Unix一样。

This is a different direction, but perhaps the Windows Subsystem for Linux would be worth investigating. 这是一个不同的方向,但也许适用于Linux的Windows子系统值得研究。 It is supposed to provide a basic degree of POSIX compatibility to a Windows environment. 它应该为Windows环境提供基本程度的POSIX兼容性。

First, 第一,

Did you restart Apache after adding the module ? 添加模块后重新启动Apache了吗? If not, you should do it. 如果没有,你应该这样做。

Next, Try the basic php multithreaded program 接下来,尝试基本的php多线程程序

<?php
class AsyncOperation extends Thread {
  public function __construct($arg){
    $this->arg = $arg;
  }

  public function run(){
    if($this->arg){
      printf("Hello %s\n", $this->arg);
    }
  }
}
$thread = new AsyncOperation("World");
if($thread->start())
  $thread->join();
?>

You seem to have followed all the necessary steps. 您似乎已经遵循了所有必要的步骤。 Should be straightforward from there. 从那里应该是直截了当的。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在win10上全局通过命令行运行PHP脚本 - Run PHP script with command line globally on win10 在 php WAMP 服务器(win10)上通过 Composer 运行 Markdownify? - Running Markdownify through Composer on php WAMP server (win10)? Win10 April更新后的Web服务器主机名问题 - Webserver hostname issue after Win10 April update PHP exec 或 shell_exec 在 Win10 + Wampserver 上只执行命令而不执行文件 - PHP exec or shell_exec only executes commands but not files on Win10 + Wampserver Win10 上的 Docker - apt-get install 返回非零代码:100 - Docker on Win10 - apt-get install returned a non-zero code: 100 PHP:shell_exec(); 与 cmd 的工作方式不同? [WIN10命令行] - PHP: shell_exec(); not working identical to cmd? [WIN10 CMD] 尝试在 Ubuntu 20.04.3 上使用带有 Win10 WSL2 的 xdebug 和 VSCode,xdebug 正在侦听但未连接? - Trying to use xdebug w/ Win10 WSL2 on Ubuntu 20.04.3 with VSCode, xdebug is listening but not connecting? 想要Xdebug——使用Win10 WSL Ubuntu 20、vscode和Laravel - Want Xdebug -- Using Win10 WSL Ubuntu 20, vscode and Laravel Laravel 5.3 - Win10 - PHPUnit - 测试代码或测试代码没有(仅)关闭自己的输出缓冲区 - Laravel 5.3 - Win10 - PHPUnit - Test code or tested code did not (only) close its own output buffers 如何配置 vscode 实时服务器以正确处理 php 文件(我使用的是 Win10 和 Chrome)? - How do I configure vscode live server to process php files properly (I'm using Win10 and Chrome)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM