PHP版本: 7.4.5
我正在运行 PHP 的线程安全版本,因为php -i|findstr "Thread"
我得到:
Thread Safety => enabled
Thread API => Windows Threads
我从以下网址下载了最新版本的 pthreads (3.1.6):https ://windows.php.net/downloads/pecl/releases/pthreads/3.1.6/ (我尝试了 32 位和 64 位版本)。
我将pthreadVC2.dll
文件放在我的php\
目录中,将php_pthreads.dll
文件放在我的php\ext\
目录中,并将该行添加extension=php_pthreads.dll
到我的php.ini
文件中
然后通过命令行运行任何 php 命令后(在我的情况下,php -v
)我在尝试 32 位版本时在控制台中得到以下内容:
PHP Warning: PHP Startup: Unable to load dynamic library 'php_pthreads.dll' (tried: C:\xampp\php\ext\php_pthreads.dll (%1 is not a valid Win32 application.), C:\xampp\php\ext\php_php_pthreads.dll.dll (The specified module could not be found.)) in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'php_pthreads.dll' (tried: C:\xampp\php\ext\php_pthreads.dll (%1 is not a valid Win32 application.), C:\xampp\php\ext\php_php_pthreads.dll.dll (The specified module could not be found.)) in Unknown on line 0
PHP 7.4.5 (cli) (built: Apr 14 2020 16:17:34) ( ZTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
尝试 64 位版本时出现此错误:
PHP Warning: PHP Startup: Unable to load dynamic library 'php_pthreads.dll' (tried: C:\xampp\php\ext\php_pthreads.dll (The specified procedure could not be found.), C:\xampp\php\ext\php_php_pthreads.dll.dll (The specified module could not be found.)) in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'php_pthreads.dll' (tried: C:\xampp\php\ext\php_pthreads.dll (The specified procedure could not be found.), C:\xampp\php\ext\php_php_pthreads.dll.dll (The specified module could not be found.)) in Unknown on line 0
PHP 7.4.5 (cli) (built: Apr 14 2020 16:17:34) ( ZTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
有任何想法吗?