在Windows上从wamp localhost运行php多线程(使用pthread)脚本


Running php multithreaded(using pthread) script from wamp localhost on Windows

我尝试在Windows上使用php pthreads执行多线程php脚本。

我已经按照以下链接,并放置了以下文件

pthreadVC2.dll

php_pthreads.dll

按照以下链接的建议http://emrahmehmedov.blogspot.com/2013/03/php-and-multi-thread-on-windows.htmlhttps://github.com/krakjoe/pthreads

我还按照建议修改了php.ini文件。

问题是:

当使用windows命令行使用'php'命令运行时,脚本执行得很好,但是当我试图从wamp-server localhost(wamp/www/)运行它时从浏览器,它给出错误"线程类未找到"。

你知道为什么会这样吗?有什么解决办法吗?因为我必须通过浏览器从wamp-server localhost运行脚本。请帮助。

要在WAMP服务器上使用浏览器中的pthreads模块,您需要将"pthreadVC2.dll"也复制到apache的"bin"目录中。

你现在应该有"pthreadVC2.dll"在这两个文件夹中(如果安装在默认位置):

C:'wamp'bin'php'php[x.x.xx]'bin
C:'wamp'bin'apache'apache[x.x.x]'bin

您还需要更新php bin目录和apache bin目录下的php.ini文件,包括:

extension=php_pthreads.dll