N
N
Nik Gubin2016-10-11 19:58:56
PHP
Nik Gubin, 2016-10-11 19:58:56

How to install pthreads under windows?

Good evening.
Either google is wrong, or I can't google... I can't find information to solve my problem.
There is a project, you need to use pthreads, there is no free server for configuration yet. Here I also discovered that open server with zts is coming and was delighted (albeit early). The fact is that since version 3.0.6 the library works only in the CLI and the open server does not want to start with it. At first I decided to take version 3.0.5, but the library and the php module in the open server were compiled with a different version of the API, and it also does not grow together.
So the question is how to overcome this problem? Maybe you can somehow load the extension at the stage of calling the command from under the console? Or somehow correctly prescribe in the config?
php 7, windows, open server.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nik Gubin, 2016-10-12
@gubin_niko

I'll answer myself, because I found a solution.
1. I downloaded the latest version of the library here: download
2. After I threw php_pthreads.dll into the php/ext/ directory, and php_pthreadVC2.dll into the php/ directory next to php.exe (and pthreadVC2.pdb there to the heap).
3. In php.ini (which is in Path_to_OpenServer\userdata\config\your_version_PHP.ini) added extension=php_pthreads.dll and restarted Open Server.
ATTENTION ! The server will try to start for a minute, but will throw a red flag. Ignore and open the server console and check php -m. We will have to see our extension there and we can execute scripts where this library is involved. Yes, you won’t launch anything in the browser, but it’s still at least some way out that I could find.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question