Reputation: 27
I am currently creating a webpage using PHP 8 that will require multiple threads. I've tried a lot with pthreads and then in the end I found out that this extension is considered dead.
Then I wanted to try out parallel\Runtime extension. The problem here is that I can't find anywhere on the Internet whether this extension can also be used for PHP 8. Other than that, I didn't managed to install it properly. I tried to solve the errors with other articles on stack-overflow but no one works for me because I use PHP 8. I worked through the following steps:
php_parallel-1.1.4-7.4-ts-vc15-x64.zip
from https://windows.php.net/downloads/pecl/releases/parallel/php_parallel.dll
file in C:\xampp\php\ext
directory and pthreadVC2.dll
in C:\xampp\php
directory.php.ini
file I've added at the very bottom extension=parallel
. Additional I've checked that my extension_dir
has the absolute path (extension_dir="C:\xampp\php\ext"
)But if I go in my console and type php -v
following error occurs (Some text is in german):
PHP Warning: PHP Startup: Unable to load dynamic library 'parallel' (tried: C:\xampp\php\ext\parallel (Das angegebene Modul wurde nicht gefunden), C:\xampp\php\ext\php_parallel.dll (Das angegebene Modul wurde nicht gefunden)) in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'parallel' (tried: C:\xampp\php\ext\parallel (Das angegebene Modul wurde nicht gefunden), C:\xampp\php\ext\php_parallel.dll (Das angegebene Modul wurde nicht gefunden)) in Unknown on line 0
PHP 8.0.9 (cli) (built: Jul 29 2021 14:12:19) ( ZTS Visual C++ 2019 x64 )
Copyright (c) The PHP Group
Zend Engine v4.0.9, Copyright (c) Zend Technologies
with Xdebug v3.0.4, Copyright (c) 2002-2021, by Derick Rethans
I don't know how to fix this problem so that I can multithread in PHP 8.
Upvotes: 1
Views: 924
Reputation: 11
I had the same problem. I noticed that i downloaded the same file php_parallel-1.1.4-7.4-ts-vc15-x64.zip that means - it works for PHP 7.4 I tested it with PHP 7.4 and yes, it works
Upvotes: 1