Question

am trying to execute a multithreaded php script using php pthreads on Windows.

I have followed the following links, and placed the following files

pthreadVC2.dll

php_pthreads.dll

as suggested by the following links http://emrahmehmedov.blogspot.com/2013/03/php-and-multi-thread-on-windows.html https://github.com/krakjoe/pthreads

Also I have made changes to the php.ini file, as suggested.

The problem is :

The script is executed well when run using 'php' command using windows commandline, but when I try to run it from wamp-server localhost(wamp/www/) from the browser , it gives error "Thread Class not found".

Any Idea Why is this happening?? Any Solution for this?? as I have to run the script from the wamp-server localhost through browser. Please Help.

Was it helpful?

Solution

To use the pthreads module in the browser with WAMP Server you need to copy the "pthreadVC2.dll" into the apache "bin" directory also.

You should now have he "pthreadVC2.dll" in both of these folders (if installed in default location):

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

You will also need to update the php.ini file within the php bin directory and the apache bin directory to include:

extension=php_pthreads.dll
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top